Operators and Expressions MCQs
Practice free Operators and Expressions 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 85 questions — no login required.
Question 37easy
What will be the output of the following program?
void main()
{
int a, b, c, d;
a = 3;
b = 5;
c = a, b;
d = (a, b);
printf("c=%d d=%d", c, d);
}Question 38easy
Which of the following comments about the ++ operator are correct?
Question 39easy
What will be the output of this program on an implementation where "int" occupies 2 bytes?
#include <stdio.h>
void main()
{
int i = 3;
int j;
j = sizeof(++i + ++i);
printf("i=%d j=%d", i, j);
}Advertisement
Question 40easy
Which operator has the lowest priority?
Question 41easy
What will be the output?
void main(){
int a=10, b=20;
char x=1, y=0;
if(a,b,x,y){
printf("EXAM");
}
}Question 42easy
What number will z in the sample code given below?
int z, x=5, y= -10, a=4, b=2;
z = x++ - --y*b/a;Advertisement
Question 43easy
What is the output of the following statements?
int i = 0;
printf("%d %d", i, i++);Question 44easy
What is the output of the following statements?
int b=15, c=5, d=8, e=8, a;
a = b>c ? c>d ? 12 : d>e ? 13 : 14 : 15;
printf("%d", a);Question 45easy
What will be the output of the following code fragment?
void main()
{
printf("%x",-1<<4);
}