Q.1
In C programming language, which of the following type of operators have the highest precedence
Q.2
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);
}
Q.3
Which of the following comments about the ++ operator are correct?
Q.4
Which operator from the following has the lowest priority?
Q.5
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);
}
Q.6
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);
}
Q.7
Which operator has the lowest priority?
Q.8
Given b=110 and c=20, what is the value of 'a' after execution of the expression a=b-=c*=5?
Q.9
void main()
{
   int a=10, b;
   b = a++ + ++a;
   printf("%d %d %d %d", b, a++, a, ++a);
}
what will be the output when following code is executed?
Q.10
Find the output of the following program.
#include
void main()
{
   int y=10;
   if(y++>9 && y++!=10 && y++>11)
      printf("%d", y);
   else
      printf("%d", y);
}
Q.11
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);
}
Q.12
What will be the output?
void main(){ 
    int a=10, b=20;
    char x=1, y=0;
    if(a,b,x,y){ 
        printf("EXAM"); 
    } 
}
Q.13
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;
Q.14
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);
}
Q.15
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);
}
Q.16
What is the output of the following statements?
int i = 0;
printf("%d %d", i, i++);
Q.17
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);
Q.18
Consider the following program fragment, and choose the correct one
void main()
{
   int a, b = 2, c;
   a = 2 * (b++);
   c = 2 * (++b);
}
Q.19
What will be the output of the following code fragment?
void main()
{
   printf("%x",-1<<4);
}
0 h : 0 m : 1 s