WorksheetsControl Statements
Total questions: 10
Worksheet time: 5mins
What is the output of the C Program.?
int main()
{
if( 4 > 5 )
{
printf("Hurray..\n");
}
printf("Yes");
return 0;
}
Yes
Hurray..
Yes
Hurray..Yes
Compiler error
The keyword ‘break’ cannot be simply used within
do-while
if-else
for
while
Which keyword is used to come out of a loop only for that iteration?
break
continue
return
None of the mentioned
goto can be used to jump from main to within a function?
TRUE
FALSE
May Be
Can't Say
Switch statement accepts.
int
char
long
All of the above
Which loop is guaranteed to execute at least one time.
while
do while
for
None of the above
For loop in a C program, if the condition is missing?
it is assumed to be present and taken to be false
it is assumed to be present and taken to the true
it result in a syntax error
execution will be terminated abruptly
What is the output of this program?
void main()
{
if(!printf(""))
printf("hello");
else
printf("world");
}
hello
world
Compilation Error
None of the above
What is the output of this C code?
void main()
{
int i = 0;
if (i == 0)
{
printf("Hello");
break;
}
}
Hello is printed infinite times
Hello
varies
compile time error
What is the output of C Program.?
int main()
{
int a=5;
while(a==5)
{
printf("RABBIT");
break;
}
return 0;
}
RABBIT is printed unlimited number of times
RABBIT
Compiler error
None of the above.
