-
*edit...i figured out what was wrong with that program
but would appreciate if anyone thats involved in C++ Programming..
could help me writing another program - we have to write a program to list all the numbers from 112 to 212 along with the cumulative total..
i just need some guidance..plz
-
c++ program help
hey man what you got to do is :
take one variable i
start for loop where i=112 and end up with 212 and just write down following thing
j=j+i;
and print j at end you will get total of that all number i think you probably know which data type you should select because that is going to be big amount...
dont forget to declare j out side of the loop as 0 otherwise be problem
-
int fromValue=112;
int toValue=212;
int sumTotal=0;
for(fromValue=112;fromValue<=toValue;fromValue++){
use printstatement c.out on fromValue
sumTotal = sumTotal+fromValue;
}
use printstatement c.out on sumTotal
-
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules