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 289easy
What will be the output of the following C code?
#include <stdio.h>
int main()
{
int x = 0, y = 2;
if (!x && y)
printf("true\n");
else
printf("false\n");
}Question 290easy
What will be the output of the following C code?
#include <stdio.h>
int main()
{
if (~0 == 1)
printf("yes\n");
else
printf("no\n");
}Question 291easy
Which keyword is used to prevent any changes in the variable within a C program?
Advertisement
Question 292easy
What will be the output of the following C code?
#include <stdio.h>
int main()
{
int x = 2, y = 0;
int z = y && (y |= 10);
printf("%d\n", z);
return 0;
}Question 293easy
Which of the following is not an arithmetic operation?
Question 294easy
What will be the output of the following C code?
#include<stdio.h>
enum hi{a,b,c};
enum hello{c,d,e};
main()
{
enum hi h;
h=b;
printf("%d",h);
return 0;
}Advertisement
Question 295easy
What will be the output of the following C code?
#include <stdio.h>
int main()
{
if (7 & 8)
printf("Honesty");
if ((~7 & 0x000f) == 8)
printf("is the best policy\n");
}Question 296easy
What will be the output of the following C code?
#include<stdio.h>
enum Shyam
{
a,b,c=5
};
int main()
{
enum Shyam s;
b=10;
printf("%d",b);
}Question 297easy
What will be the output of the following C code?
#include <stdio.h>
void main()
{
int y = 3;
int x = 5 % 2 * 3 / 2;
printf("Value of x is %d", x);
}