C Fundamentals MCQs
Practice free C Fundamentals multiple-choice questions with instant answer feedback and step-by-step solutions. Click an option to check yourself, reveal the full explanation, and work through all 303 questions — no login required.
Question 280easy
What will be the output of the following C code?
#include <stdio.h>
void main()
{
int k = 8;
int m = 7;
k < m ? k++ : m = k;
printf("%d", k);
}Question 281easy
What will be the output of the following C code?
#include <stdio.h>
enum example {a = 1, b, c};
enum example example1 = 2;
enum example answer()
{
return example1;
}
int main()
{
(answer() == a)? printf("yes"): printf("no");
return 0;
}Question 282easy
Point out the error (if any) in the following C code?
#include<stdio.h>
enum hello
{
a,b,c;
};
main()
{
enum hello m;
printf("%d",m);
}Advertisement
Question 283easy
What will be the output of the following C code?
#include <stdio.h>
int main()
{
int x = -2;
if (!0 == 1)
printf("yes\n");
else
printf("no\n");
}Question 284easy
String handling functions such as strcmp(), strcpy() etc can be used with enumerated types.
Question 285easy
What will be the output of the following C code?
#include <stdio.h>
int main()
{
int y = 1, x = 0;
int l = (y++, x++) ? y : x;
printf("%d\n", l);
}Advertisement
Question 286easy
The name of the variable used in one function cannot be used in another function.
Question 287easy
Do logical operators in the C language are evaluated with the short circuit?
Question 288easy
Which operators of the following have same precedence?
P. "!=", Q. "+=", R. "<<="