Control Structures - Study Mode
[#86] What will be the output of the following C code? #include <stdio.h>
int main()
{
int x = 0
if (x == 0)
printf("true, ")
else if (x = 10)
printf("false, ")
printf("%d
", x)
}
Correct Answer
(B) true, 0
[#87] 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
[#88] What will be the correct syntax for running two variable for loop simultaneously?
Correct Answer
(B) for (i = 0, j = 0
i < n, j < n
i++, j += 5)
[#89] Which for loop has range of similar indexes of 'i' used in for (i = 0
i < n
i++)?
Correct Answer
(D) for (i = n-1
i>-1
i-)
[#90] What will be the output of the following C code? #include <stdio.h>
int main()
{
do
printf("In while loop ")
while (0)
printf("After loop
")
}
Correct Answer
(B) In while loop After loop