cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
help please!!
help please!!
Apr 12, 2016 at 4:24pm UTC
ashley21466
(18)
what is wrong with this statement
int loopy = 1;
do
cout << "Body of Loop.";
loopy++;
while (loopy = 1);
Apr 12, 2016 at 4:57pm UTC
MrHutch
(1822)
What do
you
think is wrong with it?
Apr 12, 2016 at 5:49pm UTC
Thomas1965
(4571)
You forgot the curly braces. Also in the while condition I gues you wanted to compare loopy with 1 (?), but the comparison operator is ==.
This should work:
1
2
3
4
5
6
int
loopy = 1;
do
{ cout <<
"Body of Loop."
; loopy++; }
while
(loopy == 1);
Topic archived. No new replies allowed.