1)
What will the out put of the following
int main()
{
int
i=5;
i=++i+i+++i++;
printf("\n%d",i);
}
a)20 b)24
c)21 d)none
2) int main() {
Printf(“%d %d
%d”,sizeof(3.14F),sizeof(3.14),sizeof(3.14L));
a)4,8,8 b)4 4 4 c)4
8 10 d)4 4 10
3) int main()
{ int x=10;
printf("\n%d
%d %d",x++,++x,x++,x=sizeof(x));
}
a)10 11 12 b)3 4 4 c) 4 4
2 d)none
4) int main()
{
printf("\n%d",sizeof(1F));
}
a)8 b)2 c)4 d)none
5) int main()
{
char ch='07'+1;
printf("\n%d",ch);
}
a)1 b)49 c)08 d)8
6) void main()
{int a,b;
a=1,3,5;
b=(1,4,5),(1,2,3);
printf("%d",a+b);
}
a)6 b)2
c)4 d)8
7) void main()
{
int a=4,b=6;
if(++a==--b && 1)
printf("\ntrue");
else;
printf(" false");
}
a)true b)false c)true
false d)error
8) void main()
{
int ch='0';
switch(ch)
{
case 0: printf("0 is a
number"); break;
case 48:printf("\n0 ascii val is 48");
}}
a)0 ascii val is 48 b)error
c)0 is a number d)none
9) void main()
{ while(1,2,'a',0)
{
printf("abc");
}
printf("
def");
}
a)abc def b)error c)
def d)abc abc abc def
10) void main()
{
int
i=1;
for(;i++<=5;printf("%d,",i));
}
a)2,3,4,5,6 b)1,2,3,4,5 c)error
d)1,2,3,4
11)main()
{
Char*str=”Chennai”;
Printf(“\n%s”,str,*(++str));
}
a)Chennai b)hennai c)C d)none
12) int main()
{
no[3][3]={{1,2,3},{3},{0}};
printf(“\n%d”,0[no[1]]);
}
a)3 b)0 c)error
d)2
13) main()
{
char n1[6]={‘a’,’b’,’c’};
char
n1[7]={‘a’,’b’,’c’};
puts(n1);
puts(n2);
}
a)abc b)abc c)abc
abc d)none
abc abc
14)
main()
{
Char
str[]=”ongole\0town”;
Printf(“\n%d”,sizeof(str));
}
a)6 b)7 c)11 d)10
15)main()
{
Int
no[]={10,20,30,40,50};
Printf(“\n%d”,*n,*(n++),*(--n));
}
a)10 b)error
c)20 d)0
16)
main()
{
Int no[]={!0,20,30};
Int *n;
n=&no+2;
printf(“\n%d”,*n);
}
a)12 b)30 c)error d)10
17)main()
{
printf(“\n%8.4s”,”RISE_OGL”);
}
a)
RISE
b)RISE_OGL c)RISE_ d) error
18) # include <stdio.h>
void main()
{
char
*str;
clrscr();
printf("%d",strlen(strcpy(str,"str")));
}
a)error b)3 c)0 d)error