Control Structures - Study Mode
[#61] What will be the output of the following C code? #include <stdio.h>
int main()
{
int a = 1
switch (a)
{
case a:
printf("Case A ")
default:
printf("Default")
}
}
Correct Answer
(D) Compile time error
[#62] What will be the output of the following C code? #include <stdio.h>
int main()
{
int i = 0, j = 0
while (l1: i < 2)
{
i++
while (j < 3)
{
printf("loop
")
goto l1
}
}
}
Correct Answer
(B) Compile time error
[#63] What will be the output of the following C code? #include <stdio.h>
int main()
{
int i = 0, j = 0
while (i < 2)
{
l1 : i++
while (j < 3)
{
printf("Loop
")
goto l1
}
}
}
Correct Answer
(D) Infinite Loop
[#64] What will be the output of the following C code? #include <stdio.h>
void main()
{
int i = 5, k
if (i == 0)
goto label
label: printf("%d", i)
printf("Hey")
}
Correct Answer
(C) 5 Hey
[#65] What will be the output of the following C code? #include <stdio.h>
int main()
{
for (int i = 0
i < 1
i++)
printf("In for loop
")
}
Correct Answer
(C) Depends on the standard compiler implements