39.5k views
2 votes
Explain if statement as decision making
with a block diagram and c++ code

User Terseus
by
5.4k points

1 Answer

5 votes

Answer:

If statement requires a condition. Like if(w==0), and so on. And it has else as an alternative option in case condition fails as well as it can run the if-else if ladder.

like

if( condition1)

else if ( condition 2)

else if (condition 3)

else if (condition 4)

else

..............

and likewise.

And we here have a c++ block:

if( w<=0)

{

cout<<"you are one";

}

else

{

cout<<"You are not one";

}

Step-by-step explanation:

Please check the answer section.

User MoxieBall
by
5.4k points