NEW
Font size
WorksheetsMCA-Quiz-2
Total questions: 11
Worksheet time: 9mins
What is the output of the C program?
int main()
{
int a = -25%-10;
int b = -25%10;
int c = 25%-10;
printf("%d %d %d", a, b, c);
}
5 -5 -5
5 -5 5
-5 -5 5
5 5 5
What is the output of C Program?
int main()
{
int a=0;
a = printf("41");
printf("%d",a);
return 0;
}
compiler error
2
41
412
What is the output of the C Program.?
int main()
{
if( 4 > 5 );
{
printf("Hello\t");
printf("Hi");
}
printf("Yes");
return 0;
}
Hello Hi
Yes
Hello Hi Yes
Compiler Error
What is the output of C Program.?
int main()
{
int a=9;
if(a=8)
{
printf("Hello\t");
}
printf("Hi");
return 0;
}
Hello
Hi
Hello Hi
Compiler Error
What is the output of C Program.?
int main()
{
int a=9, b;
b = (a==9) ? (printf("Hello");printf("T")) : (printf("F"));
return 0;
}
HelloT
F
Compiler Error
Runtime Error
What is the output of C Program.?
int main()
{
int a=5,b=6;
int c= (a>b) && (a == --b) || (++a<b);
printf("a= %d b=%d c=%d",a,b,c);
return 0;
}
a= 5 b=5 c=0
a= 6 b=5 c=0
a= 6 b=6 c=0
a= 5 b=5 c=1
What is the output of C Program.?
int main()
{
int m,i=0,j=1,k=2;
int m= i++ || j++ ||k++;
printf("m=%d i= %d j=%d k=%d",m,i,j,k);
return 0;
}
m=1 i=1 j=1 k=2
m=1 i=1 j=2 k=2
m=1 i=1 j=2 k=3
m=1 i=0 j=1 k=2
What is the output of C Program? where size of int is 2 bytes.
int main()
{
int i=3,j;
j= sizeof(++i);
printf("i=%d j= %d",i,j);
return 0;
}
i=4 j=2
i=3 j=2
behavior is undefined
compiler Error
Which Operator has the lowest priority?
++
+
%
||
&&
What is the output of C Program? where size of int is 2 bytes.
int main()
{
int a=2,b=3,c=0,d=8;
if(a,b,d,c)
{
printf("Hello");
}
printf("Hi");
return 0;
}
Hello
Hi
HelloHi
None of these
what will be the output?
int main()
{
printf("%x",-1<<4);
return 0;
}
fff1
ffff
fff0
fff2
