1. What will be the output of the following C code?
#include <stdio.h>
int main()
{
printf("examveda\r\nclass\n");
return 0;
}
#include <stdio.h>
int main()
{
printf("examveda\r\nclass\n");
return 0;
}
2. What will be the output of the following C code?
#include<stdio.h>
main()
{
typedef int a;
a b=2, c=8, d;
d=(b*2)/2+8;
printf("%d",d);
}
#include<stdio.h>
main()
{
typedef int a;
a b=2, c=8, d;
d=(b*2)/2+8;
printf("%d",d);
}
3. Which of the following cannot be a variable name in C?
4. What will be the output of the following C code?
#include <stdio.h>
int main()
{
int i = -3;
int k = i % 2;
printf("%d\n", k);
}
#include <stdio.h>
int main()
{
int i = -3;
int k = i % 2;
printf("%d\n", k);
}
5. What will be the output of the following C code?
#include <stdio.h>
void main()
{
int a = 5, b = -7, c = 0, d;
d = ++a && ++b || ++c;
printf("\n%d%d%d%d", a, b, c, d);
}
#include <stdio.h>
void main()
{
int a = 5, b = -7, c = 0, d;
d = ++a && ++b || ++c;
printf("\n%d%d%d%d", a, b, c, d);
}
6. Which type of conversion is NOT accepted?
7. What will be the output of the following C code?
#include <stdio.h>
int main()
{
int x = 2, y = 0;
int z = (y++) ? y == 1 && x : 0;
printf("%d\n", z);
return 0;
}
#include <stdio.h>
int main()
{
int x = 2, y = 0;
int z = (y++) ? y == 1 && x : 0;
printf("%d\n", z);
return 0;
}
8. What will be the output of the following C code?
#include <stdio.h>
int main()
{
int a = 10;
double b = 5.6;
int c;
c = a + b;
printf("%d", c);
}
#include <stdio.h>
int main()
{
int a = 10;
double b = 5.6;
int c;
c = a + b;
printf("%d", c);
}
9. What will be the output of the following C code?
#include <stdio.h>
int main()
{
int x = 1, y = 2;
int z = x & y == 2;
printf("%d\n", z);
}
#include <stdio.h>
int main()
{
int x = 1, y = 2;
int z = x & y == 2;
printf("%d\n", z);
}
10. A variable declared in a function can be used in main().
Read More Section(C Fundamentals)
Each Section contains maximum 100 MCQs question on C Fundamentals. To get more questions visit other sections.