41. What will be the output?
void main(){
int a=10, b=20;
char x=1, y=0;
if(a,b,x,y){
printf("EXAM");
}
}
void main(){
int a=10, b=20;
char x=1, y=0;
if(a,b,x,y){
printf("EXAM");
}
}
42. 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;
int z, x=5, y= -10, a=4, b=2;
z = x++ - --y*b/a;
43. What is the output of the following statements?
int i = 0;
printf("%d %d", i, i++);
int i = 0;
printf("%d %d", i, i++);
44. 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);
int b=15, c=5, d=8, e=8, a;
a = b>c ? c>d ? 12 : d>e ? 13 : 14 : 15;
printf("%d", a);
45. What will be the output of the following code fragment?
void main()
{
printf("%x",-1<<4);
}
void main()
{
printf("%x",-1<<4);
}
46. 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);
}
#include<stdio.h>
void main()
{
int y=10;
if(y++>9 && y++!=10 && y++>11)
printf("%d", y);
else
printf("%d", y);
}
47. 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);
}
#include<stdio.h>
void main()
{
int y=10;
if(y++>9 && y++!=11 && y++>11)
printf("%d", y);
else
printf("%d", y);
}
48. 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);
}
#include<stdio.h>
void main()
{
int a, b=7;
a = b<4 ? b<<1 : ++b>4 ? 7>>1 : a;
printf("%d %d", a, b);
}
49. 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);
}
#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);
}
50. Consider the following program fragment, and choose the correct one.
void main()
{
int a, b = 2, c;
a = 2 * (b++);
c = 2 * (++b);
}
void main()
{
int a, b = 2, c;
a = 2 * (b++);
c = 2 * (++b);
}