Define flow control statements

Estudies4you
Q6. Discuss in brief about strings.
Answer :

String
In C++, string is defined as a set of characters stored in memory in sequential order. Strings are enclosed in a single or double quotes and end with a null character '\O'

Syntax
char<stringname>
Here, char is the data type and stringname is the name of the string. A string is stored in the memory in the below given manner.
H
e
l
l
o
\O
Here, the compiler stores five characters of string “Hello” in five entries and the null character in last entry.


Q7. Define flow control statements.
Answer : 

Flow control statements can be defined as the statements which control the flow of program execution. Flow control statements are of three types.

1. Conditional control statements
2. Loop statements
3. Jump statements.

1. Conditional Control Statements
These statements check the condition and execute the statements depending upon the result which can be either true (or) false. These types of conditional statements are as follows,
(a) if
(b) if-else
(c) -switch.

2. Loop Statements
These are the statements, which are executed repeatedly until a condition is satisfied. The following are loop statements.
(a) for
(b) while
(c) . do-while.

3. Jump Statements
Jump statements are the statements which are used to skip over the loop by terminating a set of statements. The various types of Jump statements are as follows,
(a) break
(b) continue
(c) goto.

To Top