61. What will be the output of the following C code?
#include <stdio.h>
int main()
{
int i = 2;
int j = ++i + i;
printf("%d\n", j);
}
#include <stdio.h>
int main()
{
int i = 2;
int j = ++i + i;
printf("%d\n", j);
}
62. What will be the final value of j in the following C code?
#include <stdio.h>
int main()
{
int i = 10, j = 0;
if (i || (j = i + 10))
//do something
;
}
#include <stdio.h>
int main()
{
int i = 10, j = 0;
if (i || (j = i + 10))
//do something
;
}
63. What will be the output of the following C function?
#include <stdio.h>
enum birds {SPARROW, PEACOCK, PARROT};
enum animals {TIGER = 8, LION, RABBIT, ZEBRA};
int main()
{
enum birds m = TIGER;
int k;
k = m;
printf("%d\n", k);
return 0;
}
#include <stdio.h>
enum birds {SPARROW, PEACOCK, PARROT};
enum animals {TIGER = 8, LION, RABBIT, ZEBRA};
int main()
{
enum birds m = TIGER;
int k;
k = m;
printf("%d\n", k);
return 0;
}
64. What is the size of an int data type?
65. What will be the output of the following C code?
#include <stdio.h>
void main()
{
int k = 8;
int m = 7;
int z = k < m ? k++ : m++;
printf("%d", z);
}
#include <stdio.h>
void main()
{
int k = 8;
int m = 7;
int z = k < m ? k++ : m++;
printf("%d", z);
}
66. Pick the incorrect statement with respect to enums.
67. What will be the output of the following C code?
#include <stdio.h>
int main()
{
int x = 2, y = 0;
int z;
z = (y++, y);
printf("%d\n", z);
return 0;
}
#include <stdio.h>
int main()
{
int x = 2, y = 0;
int z;
z = (y++, y);
printf("%d\n", z);
return 0;
}
68. What will be the output of the following C code?
#include <stdio.h>
int main()
{
int x = 1, y = 0;
x &&= y;
printf("%d\n", x);
}
#include <stdio.h>
int main()
{
int x = 1, y = 0;
x &&= y;
printf("%d\n", x);
}
69. What will be the output of the following C code?
#include <stdio.h>
void main()
{
int a = 5 * 3 % 6 - 8 + 3;
printf("%d", a);
}
#include <stdio.h>
void main()
{
int a = 5 * 3 % 6 - 8 + 3;
printf("%d", a);
}
70. What will be the output of the following C code?
#include <stdio.h>
void main()
{
float x = 0.1;
if (x == 0.1)
printf("India");
else
printf("Advanced C Classes");
}
#include <stdio.h>
void main()
{
float x = 0.1;
if (x == 0.1)
printf("India");
else
printf("Advanced C Classes");
}
Read More Section(C Fundamentals)
Each Section contains maximum 100 MCQs question on C Fundamentals. To get more questions visit other sections.