If and Else Statements

Hello,

I am new to C++ programming and I am having trouble writing if and else statements. Can someone give me an example of how if and else statements are supposed to be written. Thanks.

1
2
3
4
5
6
7
if(condition)
{
 //do stuff
} else 
{
  //do other stuff
}
Last edited on
Thanks, hanst99!
The else part is optional by the way.
Topic archived. No new replies allowed.