-
What will be the output of the following C code?
#include <stdio.h>
int main()
{
int k = 0, L = 0;
while (Level1: k < 5)
{
k++;
while (L < 6)
{
printf("Interveiw Maina\n");
goto Level1;
}
}
}
-
- "Interveiw Maina" is printed one time
- "Interveiw Maina" is printed infinite time
- Compilation Error
- Garbage value
- None of these
Correct Option: C
Compilation Error
main.c: In function ‘main’:
main.c:5:16: error: ‘Level1’ undeclared (first use in this function)
while (Level1: k < 5)
^~~~~~
main.c:5:16: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:22: error: expected ‘)’ before ‘:’ token
while (Level1: k < 5)
^
main.c:11:17: error: label ‘Level1’ used but not defined
goto Level1;