main()
{
xyz: goto abc;
printf("Hello");
abc: printf("World");
goto xyz;
}
Infinite loop
Hello World
World Hello
Compilation error
A. Infinite loop
True
False
True
False
void main()
{
int a = 0;
while (a<=50) for(;;) if(++a % 50==0) break;
printf("a = %d", a);
}
a = 100
a = 50
compilation error
runtime error
True
False
35
45
55
40
True
False
True
False
True
False
?,-
?,:
++<--
none of the above
main()
{
int a = 0;
for (; i = 0; i++)
printf("%d", a);
}
0
Nothing will be displayed
Infinite loop
None of the above
An Editor
A compiler
An operating system
None of the above
True
False
int f(int a, int b);
void main()
{
int a = 12, b=154;
printf("%d", f(a, b));
}
int f(int a, int b)
{
if (a<b) return(f(b, a));
if(b==0) return(a);
return (f(b, a % b));
}
2
1
Compilation error
Runtime error
break
continue
exit
All of the above
for
while
do-while
while & do-while
/ + *
* / +
+ / *
* / + -
main()
{
unsigned int a = 10;
while (a>=10)
{
int a; a-- ;
}
printf("%i", a);
}
Infinite loop
9
0
None
void main()
{
int a = 20;
printf("%d\t%d
", ++a, a);
}
21 21
20 21
21 20
20 20
int x=40;
main(){
int x=20;
printf("
%d",x);
}
40
20
Compilation Error
Garbeg Value
An array is a collection of variables that are of the dissimilar data type.
An array is a collection of variables that are of the same data type.
An array is not a collection of variables that are of the same data type.
None of the above.
[]
{}
()
None of the above
True
False
True
False
True
False
True
False
True
False
253
254
255
256
main()
{
int a[10], i;
for (i = 1; I <= 0; i++)
{
scanf("%d", a[i]);
printf("%d", a[i]);
}
}
10
Logical error
Runtime error
1 to 10 will be displayed
True
False
Work same as printf()
prints the error message specified by the compiler
prints the garbage value assigned by the compiler
None of the above