About C Interview Questions on Control Statements

This C interview questions on Control statements page provides all the interview questions on Control statements in C language including introduction, control statements, loops and branching statements.

C Interview Questions on Control statements

What is a Statement?
A line of code in a program.

What is control statement?
Executes randomly and repeatedly based on the given condition.

What is if block?
Executes a block of instructions if the given condition is true.

Is it mandatory to define else-block for if-block?
For if block, else block is optional
But for every else block, if the block is mandatory.

What is the use of if-else-if ladder?
Used to define more than one block and executes only one block of statements by checking condition sequentially from top to bottom.

What is nested if block?
Defining if block inside another if block.
Used to execute inner block depends on the outer block.

What is iterator?
Loops are called iterators.
Iterators are used to execute a block of instructions as long as the condition is true.

What is the difference between while and do-while?
while loop checks the condition and executes block
do-while loop executes the block and check the condition.

What is the use of nested loop?
Defining loop inside another loop is called nested loop.
Examples of nested loops
Processing 2-dimensional arrays
Printing data in a 2-dimensional format.

What is the difference between break & continue?
“break” statement is used to terminate entire loop execution or switch control statement.
“continue” statement can be used to terminate only current iteration of the loop.

Can we use a break statement in if-block?
No, we can’t use break statement directly in if-block
It is possible if the block is surrounded by any loop.

Is default-case mandatory in a switch case?
Generally, default case executes when we are looking for undefined case execution.
It is an optional case in the switch.

What is the need to break statement in a switch case?
“break” statement is used to terminate the switch after execution of a particular case.

What is the use of goto statement?
the goto statement is used to send the control from one location to another location in the program using labels.

What statement is used to terminate current iteration in the loop?
continue statement.

What are branching statements?

>C interview questions on Functions<

Share this