61. What will be the output of the following C code?
#include <stdio.h>
int main()
{
int x = -2;
x = x >> 1;
printf("%d\n", x);
}
#include <stdio.h>
int main()
{
int x = -2;
x = x >> 1;
printf("%d\n", x);
}
62. What will be the output of the following C code?
main()
{
enum resut {pass, fail};
enum result s1,s2;
s1=pass;
s2=fail;
printf("%d",s1);
}
main()
{
enum resut {pass, fail};
enum result s1,s2;
s1=pass;
s2=fail;
printf("%d",s1);
}
63. What will be the output of the following C code snippet?
#include <stdio.h>
void main()
{
unsigned int x = -5;
printf("%d", x);
}
#include <stdio.h>
void main()
{
unsigned int x = -5;
printf("%d", x);
}
64. What will be the output of the following C code?
#include <stdio.h>
void main()
{
int a = 5 * 3 + 2 - 4;
printf("%d", a);
}
#include <stdio.h>
void main()
{
int a = 5 * 3 + 2 - 4;
printf("%d", a);
}
65. All keywords in C are in . . . . . . . .
66. What will be the output of the following C code?
#include <stdio.h>
void main()
{
int k = 4;
int *const p = &k;
int r = 3;
p = &r;
printf("%d", p);
}
#include <stdio.h>
void main()
{
int k = 4;
int *const p = &k;
int r = 3;
p = &r;
printf("%d", p);
}
67. What will be the output of the following C code?
#include <stdio.h>
int main()
{
int c = 2 ^ 3;
printf("%d\n", c);
}
#include <stdio.h>
int main()
{
int c = 2 ^ 3;
printf("%d\n", c);
}
68. What will be the output of the following C code?
#include <stdio.h>
int main()
{
int x = 1;
int y = x == 1 ? getchar(): 2;
printf("%d\n", y);
}
#include <stdio.h>
int main()
{
int x = 1;
int y = x == 1 ? getchar(): 2;
printf("%d\n", y);
}
69. What will be the output of the following C code?
#include <stdio.h>
int main()
{
int y = 0;
if (1 |(y = 1))
printf("y is %d\n", y);
else
printf("%d\n", y);
}
#include <stdio.h>
int main()
{
int y = 0;
if (1 |(y = 1))
printf("y is %d\n", y);
else
printf("%d\n", y);
}
70. What will be the output of the following C code?
#include <stdio.h>
int main()
{
int y = 1;
if (y & (y = 2))
printf("true %d\n", y);
else
printf("false %d\n", y);
}
#include <stdio.h>
int main()
{
int y = 1;
if (y & (y = 2))
printf("true %d\n", y);
else
printf("false %d\n", y);
}
Read More Section(C Fundamentals)
Each Section contains maximum 100 MCQs question on C Fundamentals. To get more questions visit other sections.