| [Q001] What will be the output of the following program
: |
int main()
{
char x[]="\0";
if (printf("%s",x))
printf("Ok here.");
else
printf("Forget it.");
return 0;
}
|
(a)Ok
here. (b)Compile-Time Error (c)Forget it. (d)None of
these |
|
|
| [Q002] What will be the output of the following
program : |
int main()
{
char str1[]='H',str2[]="Mr.";
printf("%s%s",str2,str1);
return 0;
}
|
(a)XMr. (b)Compile-Time
Error (c)Mr.X (d)None
of these |
|
|
| [Q003] What will be the output of the following program
: |
#define prod(a,b) a*b
int main()
{
int x=5,y=6;
printf("%d",prod(x+2,y-1));
return 0;
}
|
(a)Compile-Time
Error (b)35 (c)16 (d)None
of these |
|
|
| [Q004] What will be the output of the following program
: |
int main()
{
short int i=32000;
while (i++!=0);
printf("%d",i);
return 0;
}
|
(a)1 (b)Infinitely (c)Compile-Time Error (d)None of these |
|
|
| [Q005] What will be the output of the following program
: |
#ifdef something
int some=0;
#endif
int main()
{
int thing = 0;
printf("%d %d\n", some ,thing);
return 0;
}
|
(a)0 0 (b)Compile-Time Error (c)None of these |
|
|
| [Q006] What will be the output of the following program
: |
#if something == 0
int some=0;
#endif
int main()
{
int thing = 0;
printf("%d %d\n", some ,thing);
return 0;
}
|
(a)0 0 (b)Compile-Time Error (c)None of these |
|
|
| [Q007] Describe the following statement : |
| void ( * abc( int, void ( *def) () ) ) ();
|
|
|
| [Q008] What will be the output of the following
program : |
int main()
{
int i=11,j=21;
i=i&=j&&21;
printf("%d %d",i,j);
return 0;
}
|
(a)11 21 (b)1 21 (c)Compile-Time
Error (d)None of these |
|
|
| [Q009] What will be the output of the following
program : |
int main()
{
int i=4,j=7;
j = j || i++;
printf("%d %d", i, j);
return 0;
}
|
(a)4 7 (b)5 7 (c)4 1 (d)5
1 (e)None
of these |
|
|
| [Q010] What will be the output of the following
program : |
int DIM(int array[])
{
return sizeof(array)/sizeof(int );
}
int main()
{
int arr[10];
printf("The dimension of the array is %d", DIM(arr));
return 0;
}
|
(a)The dimension of the array is
10 (b)The dimension of the array is 1 (c)Compile-Time
Error (d)None of
these |
|
|
|
Send
your feedback about Weekly queries - Week2 - July 2005
section to nandakishorkn@rediffmail.com
|
|
|