148k views
1 vote
The common programming structure that implements "conditional statements" is called an____ statement.

User Webeng
by
5.6k points

1 Answer

0 votes

Answer:

An if statement

Step-by-step explanation:

Conditional statements are important aspects of programming where decisions are made depending on the outcome of one or more conditions.

Generally, the conditional statements are called selection control structure but because of the general syntax which it operates on, they are regarded as if statement.

There's no limit to the number of if statement a program can have.

The syntax of an if statement goes thus:

if(condition 1) {

statements

}

else if(condition 2)

{

statements

}

.....

.....

....

else

{

statement

}

An example is a c++ program segment that compares and prints the larger number between two variables

if(x > y)

{

cout<<x<<" is greater than "<<y;

}

else if (y>x)

{

cout<<y<<" is greater than "<<x;

}

else

{

cout<<"Both numbers are equal";

}

User Aleksander Ikleiw
by
5.7k points