| [Q001] Whether the following program is a LEGAL code or
ILLEGAL code. If it is a LEGAL code, then what will be the output : |
#include<stdio.h>
main(t,_,a)
char *a;
{return!0<t?t<3?main(-79,-13,a+main(-87,1-_,
main(-86, 0, a+1 )+a)):1,t<_?main(t+1, _, a ):3,main ( -94,
-27+t, a
)&&t == 2 ?_<13 ?main ( 2, _+1, "%s %d
%d\n" ):9:16:t<0?t<-72?main(_,
t,"@n'+,#'/*{}w+/w#cdnr/+,{}r/*de}+,/*{*+,/w{%+,/w#q#n+,/#{l,+,/n{n+\
,/+#n+,/#;#q#n+,/+k#;*+,/'r :'d*'3,}{w+K w'K:'+}e#';dq#'l q#'+d'K#!/\
+k#;q#'r}eKK#}w'r}eKK{nl]'/#;#q#n'){)#}w'){){nl]'/+#n';d}rw' i;#
){n\
l]!/n{n#'; r{#w'r nc{nl]'/#{l,+'K {rw' iK{;[{nl]'/w#q#\
n'wk nw' iwk{KK{nl]!/w{%'l##w#' i; :{nl]'/*{q#'ld;r'}{nlwb!/*de}'c
\
;;{nl'-{}rw]'/+,}##'*}#nc,',#nw]'/+kd'+e}+;\
#'rdq#w! nr'/ ') }+}{rl#'{n' ')# }'+}##(!!/")
:t<-50?_==*a ?putchar(a[31]):main(-65,_,a+1):main((*a ==
'/')+t,_,a\
+1 ):0<t?main ( 2, 2 ,
"%s"):*a=='/'||main(0,main(-61,*a, "!ek;dc \
i@bK'(q)-[w]*%n+r3#l,{}:\nuwloca-O;m .vpbks,fxntdCeghiry"),a+1);}
|
|
|
| [Q002] What will be the output of the following
program : |
int main()
{
int i;
float a[5];
for (i=0; i<5; i++)
a[i] = (printf,
("%d",i/10.0));
for (i=0; i<5; i++)
printf("%.1f
",a[i]);
return(0);
}
|
(a)Compile-Time
Error
(b)0.0 0.0 0.0 0.0 0.0
(c)0.0 0.1 0.2 0.3 0.4
(d)1.0 1.0 1.0 1.0 1.0 |
|
|
| [Q003] What will be the output of the following
program : |
void func()
{
printf("Testing...Done\n");
}
int main()
{
func;
func();
return(0);
}
|
(a)Compile-Time Error
(b)Testing...Done
(c)Testing...Done
Testing...Done
(d)None of these |
|
|
| [Q004] A signed int bitfield 1-bit wide can only
hold the values : |
(a)0 and 1
(b)0 and -1
(c)0, 1 and -1
(d)None of these
|
|
|
| [Q005] What will be the output of the following
program : |
int main()
{
int a=19,b=4;
float c;
c=a/b;
printf("%f",c);
return(0);
}
|
(a)4.75
(b)4
(c)4.750000
(d)4.000000 |
|
|
| [Q006] What will be the output of the following
program : |
int main()
{
int _;
_=70;
printf("%d",_);
return(0);
}
|
(a)Compile-Time Error
(b)Run-Time Error
(c)70
(d)None of these |
|
|
| [Q007] In DOS environment, what is the maximum
combined length of the command-line arguments passed to main
(including the space between adjacent arguments and the name of the
program itself). |
(a)80 Characters
(b)128 Characters
(c)Until RETURN KEY
(d)None of these
|
|
|
| [Q008] What will be the output of the following
program : |
int main()
{
int (*foo)(char *, ...) = printf;
(*foo)("hello, %s",
"world!");
return(0);
}
|
(a)Compile-Time error
(b)hello, world!
(c)Run-Time Error
(d)None of these |
|
|
| [Q009] What will be the output of the following
program : |
int main()
{
int i=5,(*foo)(char *, ...);
foo=printf;
printf("%d",i=(*foo)("hello,
%s\n", "world!"));
return(0);
}
|
(a)Compile-Time error
(b)hello, world!
5
(c)hello, world!
13
(d)hello, world!
14 |
|
|
| [Q010] What will be the output of the following
program : |
int main()
{
int choice=2;
switch(choice)
{
default:
printf("Default1");
case 1:
printf("Case1");
break;
default:
printf("Default2");
}
return(0);
}
|
(a)Compile-Time
Error
(b)Default1Case1
(c)Default2
(d)Default1 |
|
|
| [Q011] What is the MAXIMUM LIMIT for cases in a
switch statement ? |
(a)32767
cases
(b)257 cases
(c)127
(d)None of these
|
|
|
| [Q012] What will be the output of the following
program : |
#define big(a,b)
a > b ? a : b
#define swap(a,b) temp=a; a=b; b=temp;
int main()
{
int a=3,b=5,temp;
if ((3+big(a,b)) > b)
swap(a,b);
printf("%d %d",a,b);
return(0);
}
|
(a)3
0
(b)5 3
(c)3 5
(d)5 0 |
|
|
| [Q013] What will be the output of the following
program : |
#define main
main()
void main
{
#define END }
printf("First"
"Second"
"Third");
return(0);
END
|
(a)Compile-Time
Error
(b)First
Second
Third
(c)FirstSecondThird
(d)None of these |
|
|
| [Q014] What will be the output of the following
program : |
int main()
{
long double val;
printf("%d bytes",sizeof(val));
return(0);
}
|
(a)Compile-Time Error
(b)4 bytes
(c)8 bytes
(d)10 bytes |
|
|
| [Q015] What will be the output of the following
program : |
int * func()
{
int temp=50;
return &temp;
}
int main()
{
int *val;
val = func();
printf("%d",*val);
return(0);
}
|
(a)Compile-Time Error
(b)50
(c)Garbage Value
(d)None of these |
|
|
|
Click
here to see the Solutions for the above queries.
|
|
|