Pages
About Me
Entertainment
Technologies
Practice Programs
VB Art Gallery
Contact Me
Test1
What would be the value of i and k?
main()
{
int i,j=5,k;
i=2*j/2;
k=2*(j/2);
}
5 4
4 4
4 5
5 5
What is the output of the following program?
main()
{
int i=-1;
printf(“i=%d,-i=%d”,i,-i);
}
i=1 -i=-1
i=-1 -i=-1
i=-1 -i=1
i=1 -i=1
What is the output of the following program?
main()
{
int i=10,j=40;
if((j-i)%10)
printf(“True”);
else
printf(“False”);
}
True
False
Error
None
What is the output of the following program?
main()
{
char ch[]={‘e’,’n’,’d’,’\0’,’p’};
printf(“%s”,ch);
}
'e' 'n' 'd'
'e' 'n' 'd' '\0' 'p'
end\0p
end
What is the output of the following program?
main()
{
int i;
for(i=1;i<5;i++);
printf(“Hello”);
}
print Hello 5 times
Hello
Error
None
What is the output of the following program?
main()
{
int x,y=2,z,a;
x=(y*=2)+(z=a=y);
printf(“%d”,x);
}
2
4
6
8
What are the values of x,y,z after executing the following statements?
int x=6,y=8,z;
y=x++;
z=++x;
8 6 8
6 6 6
8 8 8
6 8 6
What is the output of the following program?
main()
{
printf("%d",printf("Hello"));
}
Hello5
Hello
Error
None
What is the output of the following program?
main()
{
char x=-256;
printf(“%d”,x);
}
Error
-256
256
0
What is the output of the following program?
main()
{
int i=4,j=20;
if(i=5||j>50)
printf(“Hello”);
else
printf(“Hi”);
}
Hello
Hi
Error
None
Submit Test
Newer Post
Older Post
Home