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.

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

3 Answers

0 votes
answered Sep 17, 2017 by Admin (5,100 points)
Your question is not clear.
Do you want count sum of number from 1 to 8?
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,100 points)
I think, this will loop forever, as count is not incremented in while loop.
+1 vote
answered Sep 18, 2017 by anonymous
int count=0,total;

do{

total=count+1;

cout<<total;

++count;

}while(count<8)
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...