Menu Close

C exam on Operators

Please enter your email:

1.

Output of following Code?

#include<stdio.h>
int main()
{
  int a= 8;
  printf("%d , %d", a<<1, a<<2);
  return 0;
}

 

 
 
 
 

2.

Output of following Code?

#include<stdio.h>
int main()
{
  int x=5, y=0, a, b;
  a = ++y || ++x ;
  b = --y && ++x ;
  printf("%d, %d, %d, %d\n", x,y,a,b);
  return 0;
}

 

 
 
 
 

3.

Output of following Code?

#include<stdio.h>
int main()
{
  int x=3,y=7,z;
  z = ++x * y-- ;
  x = y-- + ++z ;
  y = z-- + x++ ;
  printf("%d, %d, %d",x,y,z);
}

 

 
 
 
 

4.

Which of the following is not compound assignment operator?

 
 
 
 

5.

Output of following Code?

#include<stdio.h>
int main()
{
  int a;
  a = sizeof('g');
  printf("%d",a);
  return 0;
}

 

 
 
 
 

6.

Output of following Code?

#include <stdio.h>
int main()
{
  int a=10, b=5, c=3;
  b != !a;
  c = !!a;
  printf("%d, %d", b, c);
  return 0;
}

 

 
 
 
 

7.

Output of following Code?

#include<stdio.h>
int main()
{
  int a=5;
  printf("%d, %d, %d", ++a, a++, --a);
  return 0;
}

 

 
 
 
 

8.

Output of following Code?

#include<stdio.h>
int main()
{
  int x=0 , y=3 ;
  x+1 ? --x : ++y ;
  printf("%d, %d", x,y);
  return 0;
}

 

 
 
 
 

9.

Output of following Code?

#include<stdio.h>
int main()
{
  int x ;
  x = (10,20,30), 40;
  printf("%d", x);
  return 0;
}

 

 
 
 
 

10.

Output of following Code?

#include<stdio.h>
int main()
{
  int a=5;
  a = a++ + ++a ;
  printf("%d", a);
  return 0;
}

 

 
 
 
 

Question 1 of 10