1.void main()
{
int const * p=5;
printf("%d",++(*p));
}
a .compiler error b.5 c.6 d.none
2.main()
{
float me = 1.1;
double you = 1.1;
if(me==you)
printf("sita");
else
printf("geetha");
}
a.sita b.geetha c.error d.none
3. main()
{
static int var = 5;
printf("%d ",var--);
if(var)
main();
}
a.5 4 3 2 1 b.4 3 2 1 c. 4 d.none
4. main()
{
extern int i;
i=20;
printf("%d",i);
}
a.compiler error b.runtime error c.linker error d.20
5. main()
{
char *p;
printf("%d %d ",sizeof(*p),sizeof(p));
}
a.1 2 b.2 1 c.1 1 d.2 2
6. main()
{
int i=3;
switch(i)
{
default:printf("zero");
case 1: printf("one");
break;
case 2:printf("two");
break;
case 3: printf("three");
break;
}
}
a.1 b.2 c.3 d.0
7. main()
{
int c= --2;
printf("c=%d",c);
}
a.2 b.1 c.error d, n
8.main()
{
printf("%p",main);
}
a. b. c. d.
9. main()
{
int i=400,j=300;
printf("%d..%d");
}
a.400 300 b. 300 400 c. 400..300 d.none
10. void main()
{
int i=5;
printf("%d",i+++++i);
}
a.linker error b.compiler error c.6 d.10
11. #include
main()
{
int i=1,j=2;
switch(i)
{
case 1: printf("GOOD");
break;
case j: printf("BAD");
break;
}
}
a. GOOD b. BAD c.compiler error d.linker error
12. main()
{
int i=-1;
+i;
printf("i = %d, +i = %d \n",i,+i);
}
a. –1,1 b. –1,0 c. –1,-1 d.1,-1
13. main()
{
main();
}
a. runtime error b. stack overflow c.both a&b d.none
14. main()
{
int i=-1;
-i;
printf("i = %d, -i = %d \n",i,-i);
}
a. –1,-1 b.-1,1 c.1,-1 d.-1,0
15. main()
{
int i=5,j=6,z;
printf("%d",i+++j);
}
a.12 b.11 c. error d.none
16. main()
{
int i =0;j=0;
if(i && j++)
printf("%d..%d",i++,j);
printf("%d..%d,i,j);
}
a.1 0 b.0 0 c.0..0 d.none
17. main()
{
char *p;
p="%d\n";
p++;
p++;
printf(p-2,300);
}
a.
18. void main()
{
char a[]="12345\0";
int i=strlen(a);
printf("here in 3 %d\n",++i);
}
a.
19. void main()
{
void *v;
int integer=2;
int *i=&integer;
v=i;
printf("%d",(int*)*v);
}
a.
20. void main()
{
int i=i++,j=j++,k=k++;
printf(“%d%d%d”,i,j,k);
}
a.
21. void main()
{
static int i=i++, j=j++, k=k++;
printf(“i = %d j = %d k = %d”, i, j, k);
}
a.
22. main()
{
unsigned int i=65000;
while(i++!=0);
printf("%d",i);
}
a b c d
23. main()
{
int i=0;
while(+(+i--)!=0)
i-=i++;
printf("%d",i);
}
a b c d.
24. main()
{
signed char i=0;
for(;i>=0;i++) ;
printf("%d\n",i);
}
a. 128 b.127 c. -128 d.0
25. main()
{
unsigned char i=0;
for(;i>=0;i++) ;
printf("%d\n",i);
}
a. 128 b.127 c.infinite loop d.none
26.
main()
{
int i=5;
printf(“%d”,i=++i ==6);
}
a. 5 b. 6 c. 1 d.
27. Is the following code legal?
struct a
{
int x;
struct a *b;
}
a. yes b.no c.cant say d.none
28. What does the following statement mean?
int (*a)[4]
(a)'a' is a pointer to an array of 4 integers
(b)'a' is an array of pointers to integer
(c)'a' is a pointer to function returning an integer
(d).none
29)what is the difference between 123 and 0123 in c?
(a)120
(b)40
(c)0
(d)...
30. The use of qualifier signed on integers is ..?
(a)Compulsory
(b)Optional
(c)Not required
(d)None of these
31. if (m%5 == 0 && n%5 == 0) is same as...
(a)if (!(m%5) && !(n%5))
(b)if (!(m%5 != 0) && !(n%5 != 0))
(c)if ((m%5 == 0) && (n%5 == m%5))
(d)All of the above
(e)None of these
No comments:
Post a Comment