control structures examples.

Nov 12, 2009 at 7:59pm
i need examples of selection control structure because im still confuse about it.
anyone?
Nov 12, 2009 at 8:06pm
Have you looked at this yet? http://www.cplusplus.com/doc/tutorial/control/
Nov 12, 2009 at 8:08pm
yes,but i still doesnt get it..can you provide me another selection example?
Nov 12, 2009 at 8:15pm
anyone? its urgent. :(
Nov 12, 2009 at 8:23pm
What kind of control structure examples are you looking for? If...else? Loops? Switches? You need to be specific.
Nov 12, 2009 at 8:30pm
oh sorry about that. im still new at this. im looking for if..else. and i just need a simple one.
Last edited on Nov 12, 2009 at 8:31pm
Nov 12, 2009 at 8:38pm
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.