|
int a[]={5,6};
printf("%d",a[1.6]);
}
a) 5, b) runtime error, c) compilation error, d) 6
ANS:d
21. #include<stdio.h>
void main(int arg c)
{
int x=1111;
printf("%d",!x);
}
a.prints 1111
b.compilation error
c.prints 0
d.is not a valid option
ans:c
23. int i=10;
a.declaration
b.definition
c.both
d.none
ans:c
25. #include<stdio.h>
void main(int arg c)
{
char a[]=abcdefghijklmnopqrstuvwxyz;
char *p=a;
printf(%d,strlen(p));
p+=10;
printf(%d,strlen(a));
}
a.26 26
b.26 16
c.compilation error
d.16 26
ans:a
27. if the following program (myprog)is run from the command line as
myprog 1 2 3
what would be the output?
Main(int argc , char *argv[])
{
int I ,j=0;
for (I=0;I<argc;I++)
j=j+atoi(argv[i]);
|
|