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 and Else Statements
If and Else Statements
Sep 18, 2011 at 7:13pm UTC
Code Assassin
(326)
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.
Sep 18, 2011 at 7:17pm UTC
hanst99
(2869)
1
2
3
4
5
6
7
if
(condition) {
//do stuff
}
else
{
//do other stuff
}
Last edited on
Sep 18, 2011 at 7:17pm UTC
Sep 18, 2011 at 7:18pm UTC
Code Assassin
(326)
Thanks, hanst99!
Sep 18, 2011 at 7:21pm UTC
hanst99
(2869)
The else part is optional by the way.
Topic archived. No new replies allowed.