cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
If without else?
If without else?
Jan 31, 2013 at 5:50am UTC
Doctor Zombie
(7)
As the title says, is it possible to have an if without an else? I am making a rock, paper, scissors program and the only way I could think of doing it is by using multiple 'if's.
Jan 31, 2013 at 5:53am UTC
Hippogriff
(727)
You do not need to include an else statement, stand alone if statements are fine in the right situations.
If you are comparing the same variable to different values you normally want to use if/else if/else to save time though.
Jan 31, 2013 at 5:56am UTC
Doctor Zombie
(7)
Thanks for the reply! That's very useful for my future programming endeavors!
Topic archived. No new replies allowed.