Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.
Login
Login
OnlineGDB Q&A
Questions
Unanswered
Tags
Ask a Question
Ask a Question
RUN THE PROGRAM THAT HAVE VALUE OF COUNT LESSTHAN 8 AND ALSO TO PRINT THE VALUE OF TOTAL(COUNT = 0 AND TOTAL =COUNT+1
+1
vote
asked
Sep 17, 2017
by
anonymous
Please
log in
or register to answer this question.
3 Answers
0
votes
answered
Sep 17, 2017
by
Admin
(
5,870
points)
Your question is not clear.
Do you want count sum of number from 1 to 8?
Please
log in
or register to add a comment.
0
votes
answered
Sep 18, 2017
by
anonymous
edited
Sep 18, 2017
by
Admin
int count = 0; int total= 0; while( count < 8) { total= count + 1; cout << total; }
commented
Sep 18, 2017
by
Admin
(
5,870
points)
I think, this will loop forever, as count is not incremented in while loop.
Please
log in
or register to add a comment.
+1
vote
answered
Sep 18, 2017
by
anonymous
int count=0,total;
do{
total=count+1;
cout<<total;
++count;
}while(count<8)
Please
log in
or register to add a comment.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and receive answers from other members of the community.
...