51. Which of the following operators has the lowest precedence?
52. Are logical operator sequence points?
53. Which expression has to be present in the following?
exp1 ? exp2 : exp3;
exp1 ? exp2 : exp3;
54. What will be the output of the following C code?
#include <stdio.h>
int main()
{
int a = 2;
int b = 0;
int y = (b == 0) ? a :(a > b) ? (b = 1): a;
printf("%d\n", y);
}
#include <stdio.h>
int main()
{
int a = 2;
int b = 0;
int y = (b == 0) ? a :(a > b) ? (b = 1): a;
printf("%d\n", y);
}
55. Which among the following is NOT a logical or relational operator?
56. What will be the output of the following C code?
#include <stdio.h>
void main()
{
char a = '0';
char b = 'm';
int c = a && b || '1';
printf("%d\n", c);
}
#include <stdio.h>
void main()
{
char a = '0';
char b = 'm';
int c = a && b || '1';
printf("%d\n", c);
}
57. What will be the output of the following C code?
#include <stdio.h>
int main()
{
int x = 2, y = 2;
int z = x ^ y & 1;
printf("%d\n", z);
}
#include <stdio.h>
int main()
{
int x = 2, y = 2;
int z = x ^ y & 1;
printf("%d\n", z);
}
58. What will be the output of the following C code?
#include <stdio.h>
void main()
{
double x = 123828749.66;
int y = x;
printf("%d\n", y);
printf("%lf\n", y);
}
#include <stdio.h>
void main()
{
double x = 123828749.66;
int y = x;
printf("%d\n", y);
printf("%lf\n", y);
}
59. What will be the final value of x in the following C code?
#include <stdio.h>
void main()
{
int x = 5 * 9 / 3 + 9;
}
#include <stdio.h>
void main()
{
int x = 5 * 9 / 3 + 9;
}
60. What will be the output of the following C code?
#include<stdio.h>
enum Ram
{
a=1,b
};
enum Shyam
{
c,d
};
int main()
{
enum Shyam s1=c;
enum Shyam s=a;
enum Ram s2=d;
printf("%d",s);
printf("%d",s1);
printf("%d",s2);
}
#include<stdio.h>
enum Ram
{
a=1,b
};
enum Shyam
{
c,d
};
int main()
{
enum Shyam s1=c;
enum Shyam s=a;
enum Ram s2=d;
printf("%d",s);
printf("%d",s1);
printf("%d",s2);
}
Read More Section(C Fundamentals)
Each Section contains maximum 100 MCQs question on C Fundamentals. To get more questions visit other sections.