control structures examples.

i need examples of selection control structure because im still confuse about it.
anyone?
Have you looked at this yet? http://www.cplusplus.com/doc/tutorial/control/
yes,but i still doesnt get it..can you provide me another selection example?
anyone? its urgent. :(
What kind of control structure examples are you looking for? If...else? Loops? Switches? You need to be specific.
oh sorry about that. im still new at this. im looking for if..else. and i just need a simple one.
Last edited on
The example in that tutorial is quite simple:
1
2
3
4
5
6
if (x > 0)
  cout << "x is positive";
else if (x < 0)
  cout << "x is negative";
else
  cout << "x is 0";

What don't you understand of it?
Topic archived. No new replies allowed.