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
square using while loop
square using while loop
Nov 8, 2015 at 8:08pm UTC
carineah
(1)
write a program that gives the square of the first five numbers. and then gives the sum of these squares.
the output is:
1
4
9
16
25
the total is: 55
Nov 8, 2015 at 8:26pm UTC
Peter87
(11238)
Do you know how to write a loop from 1 to 5? Do you know how to compute the square of a number?
Nov 9, 2015 at 5:20am UTC
integralfx
(897)
Use a for loop.
Nov 9, 2015 at 9:14am UTC
YFGHNG
(319)
http://www.cplusplus.com/doc/tutorial/control/
Topic archived. No new replies allowed.