Loops
- What will be the output of the following C code?
#include <stdio.h>
int main()
{
int k = 0, L = 0;
Level1: while (k < 3)
{
k++;
while (L < 15)
{
printf("Hey...\n");
goto Level1;
}
}
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Hey...
Hey...
Hey...
- What will be the output of the following C code?
#include <stdio.h>
int main()
{
int k = 0, L = 0;
Level1: while (k < 4)
{
k++;
while (L < 15)
{
printf("Hello...\n");
goto Level1;
}
}
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Hello...
Hello...
Hello...
Hello...
- What will be the output of the following C code?
#include <stdio.h>
void main()
{
int k = 2;
if (k == 2)
{
goto Lavel;
}
Lavel: printf("Interview Mania");
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
Interview Mania
- What will be the output of the following C code?
#include <stdio.h>
void main()
{
int n = 0, L;
if (n == 0)
goto Label;
for (L = 0; L < 3; L++)
{
printf("Hey");
Label: L = printf("%03d", n);
}
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
000
- What will be the output of the following C code?
#include <stdio.h>
void main()
{
int n = 5, L;
Label: printf("%d", n);
if (n == 5)
goto Label;
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
5 Infinite times