Professional Documents
Culture Documents
Short
Questions
Q: 1 Define control structure. Write its types.
Answer: Control structures are statements used to control the execution flow in a
program or function. The C control structure enables us to group individual
instructions into a single logical unit with one entry point and one exit point.
Types:
The following are the different types of control structures:
Sequential control structure.
Selection control structure.
Iteration control structure.
Q: 2 What is a simple if statement? Write its syntax.
Answer: If statement is the simplest form of decision construct. It allows a
statement or a set of statements to be executed conditionally. The general form
of a simple if statement is:
if (condition)
{
Statement1;
Statement2;
Statement (n);
}
Q: 3 Draw the flow chart if-else statement.
Answer:
F T
Condition
Statement Statement
Syntax:
Conditional expression? true-case statement: false-case statement;