Operators and Expressions MCQs

85 questionsC-ProgramPage 6 of 10

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 46easy
Find the output of the following program.
#include<stdio.h>
void main()
{
   int y=10;
   if(y++>9 && y++!=10 && y++>11)
      printf("%d", y);
   else
      printf("%d", y);
}
Question 47easy
Find the output of the following program.
#include<stdio.h>
void main()
{
   int y=10;
   if(y++>9 && y++!=11 && y++>11)
      printf("%d", y);
   else
      printf("%d", y);
}
Question 48easy
Determine output of the following program code.
#include<stdio.h>
void main()
{
   int a, b=7;
   a = b<4 ? b<<1 : ++b>4 ? 7>>1 : a;
   printf("%d %d", a, b);
}
Advertisement
Question 49easy
Choose the correct output for the following program.
#include<stdio.h>
void main()
{
   int a=10, b=11, c=13, d;
   d = (a=c, b+=a, c=a+b+c);
   printf("%d %d %d %d", d, a, b, c);
}
Question 50easy
Consider the following program fragment, and choose the correct one.
void main()
{
   int a, b = 2, c;
   a = 2 * (b++);
   c = 2 * (++b);
}
Question 51easy
Which operator from the following has the lowest priority?
Advertisement
Question 52easy
Identify the correct output of the following code:
void main()
{
   int w=10, x=5, y=3, z=3;
   if( (w < x ) && (y=z++) )
      printf("%d %d %d %d", w, x, y, z);
   else
      printf("%d %d %d %d", w, x, y, z);
}
Question 53easy
Given b=110 and c=20, what is the value of 'a' after execution of the expression a=b-=c*=5?
Question 54easy
what will be the output when following code is executed?
void main()
{
   int a=10, b;
   b = a++ + ++a;
   printf("%d %d %d %d", b, a++, a, ++a);
}
Operators and Expressions MCQs with Answers & Solutions — C-Program | GrabStudy