[try Beta version]
Not logged in

 
a for loop statement problem...

Sep 10, 2009 at 2:19pm
write programs to calculate each of the following quantities, in each case, N indicates a quantity specified by the user.

a. 100+101+102...+500
b.1+1/2=1/4+1/8+...+1/2N
c.1+2+3...+N
d.1+3+57+9+11+...+(2*N-1)

frankly speaking i don't have a clue where to start... i would really appreciates every help i can get.. thankz.... :P
Sep 10, 2009 at 3:22pm
Your title cites the for loop, start from there
Sep 10, 2009 at 8:20pm
Have you seen these?
http://cplusplus.com/src/
http://cplusplus.com/doc/tutorial/

You could study some of the tutorial code in order to get a general idea on the structure of a program. It seems pretty simple. All you need is a main function and some code to take input from the console. Then you write the code for the equations, and print the results for each to the screen.
Topic archived. No new replies allowed.