# Control Flow Statements in C MCQ

1. What will be the output of the following C code?

#include
void main()
{
int x = 5;
if (x < 1)
printf("hello");
if (x == 5)
printf("hi");
else
printf("no");
}

a) hi
b) hello
c) no
d) error

2. What will be the output of the following C code?

#include
int x;
void main()
{
if (x)
printf("hi");
else
printf("how are u");
}

a) hi
b) how are you
c) compile time error
d) error

3. What will be the output of the following C code?

#include
void main()
{
int x = 5;
if (true);
printf("hello");
}

a) It will display hello
b) It will throw an error
c) Nothing will be displayed
d) Compiler dependent

4. What will be the output of the following C code?

#include
void main()
{
int x = 0;
if (x == 0)
printf("hi");
else
printf("how are u");
printf("hello");
}

a) hi
b) how are you
c) hello
d) hihello

5. What will be the output of the following C code?

#include
void main()
{
int x = 5;
if (x < 1);
printf("Hello");

}

a) Nothing
b) Run time error
c) Hello
d) Varies

6. What will be the output of the following C code? (Assuming that we have entered the value 1 in the standard input)

#include
void main()
{
double ch;
printf("enter a value between 1 to 2:");
scanf("%lf", &ch);
switch (ch)
{
case 1:
printf("1");
break;
case 2:
printf("2");
break;
}
}

a) Compile time error
b) 1
c) 2
d) Varies

7. What will be the output of the following C code? (Assuming that we have entered the value 1 in the standard input)

#include
void main()
{
char *ch;
printf("enter a value between 1 to 3:");
scanf("%s", ch);
switch (ch)
{
case "1":
printf("1");
break;
case "2":
printf("2");
break;
}
}

a) 1
b) 2
c) Compile time error
d) No Compile time error

8. What will be the output of the following C code? (Assuming that we have entered the value 1 in the standard input)

#include
void main()
{
int ch;
printf("enter a value between 1 to 2:");
scanf("%d", &ch);
switch (ch)
{
case 1:
printf("1n");
default:
printf("2n");
}
}

a) 1
b) 2
c) 1 2
d) Run time error

9. What will be the output of the following C code? (Assuming that we have entered the value 2 in the standard input)

#include
void main()
{
int ch;
printf("enter a value between 1 to 2:");
scanf("%d", &ch);
switch (ch)
{
case 1:
printf("1n");
break;
printf("Hi");
default:
printf("2n");
}
}

a) 1
b) Hi 2
c) Run time error
d) 2

10. What will be the output of the following C code? (Assuming that we have entered the value 1 in the standard input)

#include
void main()
{
int ch;
printf("enter a value between 1 to 2:");
scanf("%d", &ch);
switch (ch, ch + 1)
{
case 1:
printf("1n");
break;
case 2:
printf("2");
break;
}
}

a) 1
b) 2
c) 3
d) Run time error

1. What will be the output of the following C code?

#include
int main()
{
int x = 1;
if (x > 0)
printf("inside ifn");
else if (x > 0)
printf("inside elseifn");
}

a) inside if
b) inside elseif
c) inside if
inside elseif

d) compile time error

2. What will be the output of the following C code?

#include
int main()
{
int x = 0;
if (x++)
printf("truen");
else if (x == 1)
printf("falsen");
}

a) true
b) false
c) compile time error
d) undefined behavior

3. What will be the output of the following C code?

#include
int main()
{
int x = 0;
if (x == 1)
if (x == 0)
printf("inside ifn");
else
printf("inside else ifn");
else
printf("inside elsen");
}

a) inside if
b) inside else if
c) inside else
d) compile time error

4. What will be the output of the following C code?

#include
int main()
{
int x = 0;
if (x == 0)
printf("true, ");
else if (x = 10)
printf("false, ");
printf("%dn", x);
}

a) false, 0
b) true, 0
c) true, 10
d) compile time error

5. What will be the output of the following C code?

#include
int main()
{
int x = 0;
if (x == 1)
if (x >= 0)
printf("truen");
else
printf("falsen");
}

a) true
b) false
c) Depends on the compiler
d) No print statement

6. The C statement “”if (a == 1 || b == 2) {}”” can be re-written as ___________

a) if (a == 1)
if (b == 2){}
b) if (a == 1){}
if (b == 2){}
c) if (a == 1){}
else if (b == 2){}
d) none of the mentioned

The C statement “”if (a == 1 || b == 2) {}”” can be re-written as  if (a == 1){} else if (b == 2){}

Here, the statement states if a is equal to 1 or b is equal to 2 then execute the statement.

Now, option C states that if a is equal to 1 check then again check that if b is equal to 2 then only execute the statement.

7. Which of the following is an invalid if-else statement?

a) if (if (a == 1)){}
b) if (func1 (a)){}
c) if (a){}
d) if ((char) a){}

if (if (a == 1)){} is an invalid if-else statement. The if/else statement executes a block of code if a specified condition is true. If the condition is false, another block of code can be executed.

8. What will be the output of the following C code?

#include
int main()
{
int a = 1;
if (a--)
printf("True");
if (a++)
printf("False");
}

a) True
b) False
c) True False
d) No Output

9. What will be the output of the following C code?

#include
int main()
{
int a = 1;
if (a)
printf("All is Well ");
printf("I am Welln");
else
printf("I am not a Rivern");
}

a) Output will be All is Well I am Well
b) Output will be I am Well I am not a River
c) Output will be I am Well
d) Compile time errors during compilation

10. What will be the output of the following C code?

#include
int main()
{
if (printf("%d", printf(")))
printf("We are Happy");
else if (printf("1"))
}

a) 0We are Happy
b) 1We are Happy
d) compile time error

1. What will be the output of the following C# code?

static void Main(string[] args)
{
int movie = 1;
switch (movie << 2 + movie)
{
default:
Console.WriteLine("3 Idiots");
break;
case 4:
Console.WriteLine("Ghazini");
break;
case 5:
Console.WriteLine("Krishh");
break;
case 8:
Console.WriteLine("Race");
break;
}
}

a) 3 Idiots
b) Ghazini
c) Race
d) Krishh

We can put ‘default’ cases in any order and hence write cases in any order.

2. What will be the output of the following C# code?

static void Main(string[] args)
{
int i = 2, j = 4;
switch (i + j * 2)
{
case 1 :
case 2 :
Console.WriteLine("1 and 2");
break;
case 3 to 10:
Console.WriteLine("3 to 10");
break;
}
}

a) 3 to 10 will be printed
b) 1 and 2 will be printed
c) The code reports an error as missing; before :
d) The code gives output as 3 to 10

Syntax error- switch case does not work with syntax as 3 to 10:

Here i = 2, j = 4. So, (i + j * 2) gives output as 10, and case 10 is missing. So, prints nothing for the given code.

3. What will be the output of the following C# code?

static void Main(string[] args)
{
int i = 2, k = 3;
switch (i - k)
{
case -1:
++i;
++k;
break;
case 2:
--i;
++k;
break;
default:
i += 3;
k += i;
break;
}
Console.WriteLine(i + "n" + k);
}

a) 2 3 3
b) 3 2 3
c) 3 4 4
d) 5 10 10

i – k = -1. So, case -1 will be executed only.

4. What will be the output of the following C# code?

static void Main(string[] args)
{
int const p = 0;
switch (3 * 5 / 6)
{
case p:
Console.WriteLine("A");
break;
case p * 1:
Console.WriteLine("B");
break;
case p - 2:
Console.WriteLine("C");
break;
default:
Console.WriteLine("D");
}
}

a) A
b) B
c) C
d) Compile time error

In the case of expression we don’t have a constant variable.

5. What will be the output of the following C# code?

static void Main(string[] args)
{
int i = 2, j = 3, k = 4;
switch (i + j - k)
{
case 0: case 2: case 4:
++i;
k += j;
break;
case 1: case 3: case 5 :
--i;
k -= j;
break;
default:
i += j;
break;
}
Console.WriteLine(i + "n" + j + "n" + k);
}

a) 1 3 1
b) 2 3 4
c) 5 3 4
d) Compile time error

Solving expression (i + j – k) gives 1 and hence,solving for case 1:case 3:case 5:.

6. What will be the output of the following C# code?

static void Main(string[] args)
{
int i = 9 , j = 7;
switch (i - j + 3)
{
case 9: 7:
j += 6;
break;
case 5:
i -= 4;
break;
}
Console.WriteLine(i + "n" + j);
}

a) 5 7
b) 9 13
c) Compile time error
d) 9 7

Invalid expression’7:’ in case 9:7:.

7. What will be the output of the following C# code?

static void Main(string[] args)
{
switch (5)
{
case 5.0f:
Console.WriteLine("harsh");
break;
case 5:
Console.WriteLine("amish");
break;
case 5.0L:
Console.WriteLine("ANKIT");
break;
default:
Console.WriteLine("ashish");
}
}

a) amish
b) ANKIT
c) harsh
d) Compile time error

Only integral values are allowed for case expression.
5.0f = (int)5.0f.
5.0L = (int)5.0L.

8. What will be the output of the following C# code?

static void Main(string[] args)
{
int i;
int j = 1;
int []ar = {21, 22, 13, 4};
switch (ar[j])
{
case 1:
i++;
break;
case 2:
i += 2;
j = 3;
continue;
case 3:
i %= 2;
j = 4;
continue;
default:
--i;
}
Console.WriteLine(i);
}

a) 23
b) 15
c) Compile time error
d) 12

Continue cannot be used as a part of the switch statement.

9. What will be the output of the following C# code?

static void Main(string[] args)
{
char ch = Convert.ToChar('a' | 'b' | 'c');
switch (ch)
{
case 'A':
case 'a':
Console.WriteLine("case A|case a");
break;
case 'B':
case 'b':
Console.WriteLine("case B|case b");
break;
case 'C':
case 'c':
case 'D':
case 'd':
Console.WriteLine("case D|case d");
break;
}
}

a) Compile time error
b) case A|case a
c) case B|case b
d) case D|case d

The case statement declared last will only be executed as no particular case number is declared is to be called.

10. What will be the output of the following C# code?

static void Main(string[] args)
{
char ch = 'p';
switch (ch)
{
case 'p':
Console.WriteLine("coco" + "t" + Convert.ToInt32(ch));
break;
default:
Console.WriteLine("default");
break;
}
Console.WriteLine("main");
}

a) coco main
b) coco 112
c) coco 112 main
d) compile time error

ASCII value of ‘p’ is 112. Hence, coco 112 main.

1. What will be the output of the following C code?

#include
const int a = 1, b = 2;
int main()
{
int x = 1;
switch (x)
{
case a:
printf("yes ");
case b:
printf("non");
break;
}
}

a) yes no
b) yes
c) no
d) Compile time error

2. What will be the output of the following C code?

#include
#define max(a) a
int main()
{
int x = 1;
switch (x)
{
case max(2):
printf("yesn");
case max(1):
printf("non");
break;
}
}

a) yes no
b) yes
c) no
d) Compile time error

3. What will be the output of the following C code?

#include
int main()
{
switch (printf("Do"))
{
case 1:
printf("Firstn");
break;
case 2:
printf("Secondn");
break;
default:
printf("Defaultn");
break;
}
}

a) Do
b) DoFirst
c) DoSecond
d) DoDefault

4. Comment on the output of the following C code.

#include
int main()
{
int a = 1;
switch (a)
case 1:
printf("%d", a);
case 2:
printf("%d", a);
case 3:
printf("%d", a);
default:
printf("%d", a);
}

a) No error, the output is 1111
b) No error, the output is 1
c) Compile time error, no break statements
d) Compile time error, case label outside the switch statement

5. Which datatype can accept the switch statement?

a) int
b) char
c) long
d) all of the mentioned

• A switch statement allows a variable to be tested for equality against a list of values.
• Each value is called a case, and the variable being switched on is checked for each switch case.
• int, char, and long datatype can accept the switch statement.

6. What will be the output of the following C code?

#include
int main()
{
int a = 1;
switch (a)
{
case a:
printf("Case A ");
default:
printf("Default");
}
}

a) Case A
b) Default
c) Case A Default
d) Compile time error

7. What will be the output of the following C code?

#include
switch (ch)
{
case 'a':
case 'A':
printf("true");
}

a) if (ch == ‘a’ && ch == ‘A’) printf(“true”);
b) if (ch == ‘a’)
if (ch == ‘a’) printf(“true”);
c) if (ch == ‘a’ || ch == ‘A’) printf(“true”);
d) none of the mentioned

1. The C code ‘for(;;)’ represents an infinite loop. It can be terminated by ___________

a) break
b) exit(0)
c) abort()
d) terminate

The C code ‘for(;;)’ represents an infinite loop. It can be terminated by the break.

An infinite loop is a looping construct that does not terminate the loop and executes the loop forever. It is also called an indefinite loop or an endless loop.

2. What will be the correct syntax for running two variables for a loop simultaneously?

a) for (i = 0; i < n; i++)
for (j = 0; j < n; j += 5)
b) for (i = 0, j = 0; i < n, j < n; i++, j += 5)
c) for (i = 0; i < n;i++){}
for (j = 0; j < n;j += 5){}
d) none of the mentioned

for (i = 0, j = 0; i < n, j < n; i++, j += 5) is the correct syntax for running two variable for loop simultaneously.

3. Which for loop has range of similar indexes of ‘i’ used in for (i = 0;i < n; i++)?

a) for (i = n; i>0; i–)
b) for (i = n; i >= 0; i–)
c) for (i = n-1; i>0; i–)
d) for (i = n-1; i>-1; i–)

For (i = n-1; i>-1; i–)  loop has range of similar indexes of ‘i’ used in for (i = 0;i < n; i++).

4. Which of the following cannot be used as LHS of the expression in for (exp1;exp2; exp3)?

a) variable
b) function
c) typedef
d) macros

typedef cannot be used as LHS of the expression in for (exp1;exp2; exp3).

5. What will be the output of the following C code?

#include
int main()
{
short i;
for (i = 1; i >= 0; i++)
printf("%dn", i);

}

a) The control won’t fall into the for loop
b) Numbers will be displayed until the signed limit of short and throw a runtime error
c) Numbers will be displayed until the signed limit of short and the program will successfully terminate
d) This program will get into an infinite loop and keep printing numbers with no errors

6. What will be the output of the following C code?

#include
void main()
{
int k = 0;
for (k)
printf("Hello");
}

a) Compile time error
b) hello
c) Nothing
d) Varies

7. What will be the output of the following C code?

#include
void main()
{
int k = 0;
for (k < 3; k++)
printf("Hello");
}

a) Compile time error
b) Hello is printed thrice
c) Nothing
d) Varies

8. What will be the output of the following C code?

#include
void main()
{
double k = 0;
for (k = 0.0; k < 3.0; k++)
printf("Hello");
}

a) Run time error
b) Hello is printed thrice
c) Hello is printed twice
d) Hello is printed infinitely

1. What will be the output of the following C code?

#include
void main()
{
char *str = "";
do
{
printf("hello");
} while (str);
}

a) Nothing
b) Run time error
c) Varies
d) Hello is printed infinite times

2. What will be the output of the following C code?

#include
void main()
{
int i = 0;
while (i < 10)
{
i++;
printf("hin");
while (i < 8)
{
i++;
printf("hellon");
}
}
}

a) Hi is printed 8 times, hello 7 times, and then hi 2 times
b) Hi is printed 10 times, hello 7 times
c) Hi is printed once, hello 7 times
d) Hi is printed once, hello 7 times, and then hi 2 times

3. What is an example of iteration in C?

a) for
b) while
c) do-while
d) all of the mentioned

Iteration is the process where a set of instructions or statements is executed repeatedly for a specified number of times or until a condition is met.

The example of iteration in C are

1. for
2. while
3. do-while

4. How many times while loop condition is tested in the following C code snippets if i is initialized to 0 in both cases?

while (i < n)
i++;
————-
do
i++;
while (i <= n);

a) n, n
b) n, n+1
c) n+1, n
d) n+1, n+1

5. What will be the output of the following C code?

#include
int main()
{
int i = 0;
while (i = 0)
printf("Truen");
printf("Falsen");
}

a) True (infinite time)
b) True (1 time) False
c) False
d) Compiler dependent

6. What will be the output of the following C code?

#include
int main()
{
int i = 0, j = 0;
while (i < 5, j < 10)
{
i++;
j++;
}
printf("%d, %dn", i, j);
}

a) 5, 5
b) 5, 10
c) 10, 10
d) Syntax error

7. Which loop is most suitable to first perform the operation and then test the condition?

a) for loop
b) while loop
c) do-while loop
d) none of the mentioned

The C do while statement creates a structured loop that executes as long as a specified condition is true at the end of each pass through the loop.

The do-while loop is most suitable to first perform the operation and then test the condition.

1. What will be the output of the following C code?

#include
int main()
{
while ()
printf("In while loop ");
printf("After loopn");
}

a) In while loop after loop
b) After the loop
c) Compile time error
d) Infinite loop

4. How many times i value is checked in the following C code?

#include
int main()
{
int i = 0;
do {
i++;
printf("in while loopn");
} while (i < 3);
}

a) 2
b) 3
c) 4
d) 1

5. How many times i value is checked in the following C code?

#include
int main()
{
int i = 0;
while (i < 3)
i++;
printf("In while loopn");
}

a) 2
b) 3
c) 4
d) 1

6. What will be the output of the following C code?

#include
void main()
{
int i = 2;
do
{
printf("Hi");
} while (i < 2)
}

a) Compile time error
b) Hi Hi
c) Hi
d) Varies

7. What will be the output of the following C code?

#include
void main()
{
int i = 0;
while (++i)
{
printf("H");
}
}

a) H
b) H is printed infinite times
c) Compile time error
d) Varies

8. What will be the output of the following C code?

#include
void main()
{
int i = 0;
do
{
printf("Hello");
} while (i != 0);
}

a) Nothing
b) H is printed infinite times
c) Hello
d) Run time error

1. What will be the output of the following C code?

#include
void main()
{
int i = 0;
if (i == 0)
{
printf("Hello");
continue;
}
}

a) Hello is printed infinite times
b) Hello
c) Varies
d) Compile time error

2. What will be the output of the following C code?

#include
void main()
{
int i = 0;
if (i == 0)
{
printf("Hello");
break;
}
}

a) Hello is printed infinite times
b) Hello
c) Varies
d) Compile time error

3. What will be the output of the following C code?

#include
int main()
{
int i = 0;
do
{
i++;
if (i == 2)
continue;
printf("In while loop ");
} while (i < 2);
printf("%dn", i);
}

a) In while loop 2
b) In while loop in while loop 3
c) In while loop 3
d) Infinite loop

6. What will be the output of the following C code?

#include
int main()
{
int i = 0;
char c = 'a';
while (i < 2)
{
i++;
switch (c)
{
case 'a':
printf("%c ", c);
break;
break;
}
}
printf("after loopn");
}

a) an after loop
b) an after loop
c) after loop
d) error

7. What will be the output of the following C code?

#include
int main()
{
printf("before continue ");
continue;
printf("after continuen");
}

a) Before continue after continue
b) Before continue
c) After continue
d) Compile time error

1. Which keyword can be used for coming out of recursion?

a) break
b) return
c) exit
d) both break and return

Both break and return keywords can be used for coming out of recursion.

Break and return syntax is used in function just as a jump statement in order to break the flow of the function and jump out of it.

2. What will be the output of the following C code?

#include
int main()
{
int a = 0, i = 0, b;
for (i = 0;i < 5; i++)
{
a++;
continue;
}
}

a) 2
b) 3
c) 4
d) 5

3. What will be the output of the following C code?

#include
int main()
{
int a = 0, i = 0, b;
for (i = 0;i < 5; i++)
{
a++;
if (i == 3)
break;
}
}

a) 1
b) 2
c) 3
d) 4

4. The keyword ‘break’ cannot be simply used within _________

a) do-while
b) if-else
c) for
d) while

The break in C or C++ is a loop control statement that is used to terminate the loop. The keyword ‘break’ cannot be simply used within if-else.

5. Which keyword is used to come out of a loop only for that iteration?

a) break
b) continue
c) return
d) none of the mentioned

• The continue keyword is used to come out of a loop only for that iteration.
• The continue statement in C programming works somewhat like the break statement.
• Instead of forcing termination, it forces the next iteration of the loop to take place, skipping any code in between.

6. What will be the output of the following C code?

#include
void main()
{
int i = 0, j = 0;
for (i = 0;i < 5; i++)
{
for (j = 0;j < 4; j++)
{
if (i > 1)
break;
}
printf("Hi n");
}
}

a) Hi is printed 5 times
b) Hi is printed 9 times
c) Hi is printed 7 times
d) Hi is printed 4 times

7. What will be the output of the following C code?

#include
void main()
{
int i = 0;
int j = 0;
for (i = 0;i < 5; i++)
{
for (j = 0;j < 4; j++)
{
if (i > 1)
continue;
printf("Hi n");
}
}
}

a) Hi is printed 9 times
b) Hi is printed 8 times
c) Hi is printed 7 times
d) Hi is printed 6 times

8. What will be the output of the following C code?

#include
void main()
{
int i = 0;
for (i = 0;i < 5; i++)
if (i < 4)
{
printf("Hello");
break;
}
}

a) Hello is printed 5 times
b) Hello is printed 4 times
c) Hello
d) Hello is printed 3 times

1. What will be the output of the following C code?

#include
void main()
{
int i = 5, k;
if (i == 0)
goto label;
label: printf("%d", i);
printf("Hey");
}

a) 5
b) Hey
c) 5 Hey
d) Nothing

2. goto can be used to jump from main() to within a function.

a) true
b) false
c) depends
d) varies

A goto statement in C programming provides an unconditional jump from the ‘goto’ to a labeled statement in the same function.

3. What will be the output of the following C code?

#include
int main()
{
printf("%d ", 1);
goto l1;
printf("%d ", 2);
l1:goto l2;
printf("%d ", 3);
l2:printf("%d ", 4);
}

a) 1 4
b) Compile time error
c) 1 2 4
d) 1 3 4

4. What will be the output of the following C code?

#include
int main()
{
printf("%d ", 1);
l1:l2:
printf("%d ", 2);
printf("%dn", 3);
}

a) Compile time error
b) 1 2 3
c) 1 2
d) 1 3

5. What will be the output of the following C code?

#include
int main()
{
printf("%d ", 1);
goto l1;
printf("%d ", 2);
}
void foo()
{
l1: printf("3 ", 3);
}

a) 1 2 3
b) 1 3
c) 1 3 2
d) Compile time error

6. What will be the output of the following C code?

#include
int main()
{
int i = 0, j = 0;
while (i < 2)
{
l1: i++;
while (j < 3)
{
printf("loopn");
goto l1;
}
}
}

a) loop loop
b) Compile time error
c) loop loop loop loop
d) Infinite loop

7. What will be the output of the following C code?

#include
int main()
{
int i = 0, j = 0;
while (l1: i < 2)
{
i++;
while (j < 3)
{
printf("loopn");
goto l1;
}
}
}

a) loop loop
b) Compile time error
c) loop loop loop loop
d) Infinite loop

8. What will be the output of the following C code?

#include
int main()
{
int i = 0, j = 0;
l1: while (i < 2)
{
i++;
while (j < 3)
{
printf("loopn");
goto l1;
}
}
}

a) loop loop
b) Compile time error
c) loop loop loop loop
d) Infinite loop

1. What will be the output of the following C code?

#include
int main()
{
printf("%d ", 1);
goto l1;
printf("%d ", 2);
l1:goto l2;
printf("%d ", 3);
l2:printf("%d ", 4);
}

a) 1 4
b) Compilation error
c) 1 2 4
d) 1 3 4

2. What will be the output of the following C code?

#include
int main()
{
printf("%d ", 1);
l1:l2:
printf("%d ", 2);
printf("%dn", 3);
}

a) Compilation error
b) 1 2 3
c) 1 2
d) 1 3

3. What will be the output of the following C code?

#include
int main()
{
printf("%d ", 1);
goto l1;
printf("%d ", 2);
}
void foo()
{
l1 : printf("3 ", 3);
}

a) 1 2 3
b) 1 3
c) 1 3 2
d) Compilation error

4. What will be the output of the following C code?

#include
int main()
{
int i = 0, j = 0;
while (i < 2)
{
l1 : i++;
while (j < 3)
{
printf("Loopn");
goto l1;
}
}
}

a) Loop Loop
b) Compilation error
c) Loop Loop Loop Loop
d) Infinite Loop

h({});

5. What will be the output of the following C code?

#include
int main()
{
int i = 0, j = 0;
while (l1: i < 2)
{
i++;
while (j < 3)
{
printf("loopn");
goto l1;
}
}
}

a) loop loop
b) Compilation error
c) loop loop loop loop
d) Infinite loop

6. What will be the output of the following C code?

#include
int main()
{
int i = 0, j = 0;
l1: while (i < 2)
{
i++;
while (j < 3)
{
printf("loopn");
goto l1;
}
}
}

a) loop loop
b) compilation error
c) oop loop loop loop
d) infinite loop

7. What will be the output of the following C code?

#include
void main()
{
int i = 0;
if (i == 0)
{
goto label;
}
label: printf("Hello");
}

a) Nothing
b) Error
c) Infinite Hello
d) Hello

8. What will be the output of the following C code?

#include
void main()
{
int i = 0, k;
if (i == 0)
goto label;
for (k = 0;k < 3; k++)
{
printf("hin");
label: k = printf("%03d", i);
}
}

a) 0
b) hi hi hi 0 0 0
c) 0 hi hi hi 0 0 0
d) 0 0 0

9. What will be the output of the following C code?

#include
void main()
{
int i = 0, k;
label: printf("%d", i);
if (i == 0)
goto label;
}

a) 0
b) Infinite 0
c) Nothing
d) Error