Help loop problem

please help me with this

1. Write a program to list the numbers from 0-25, their squares, 3rd power, and 4th power.

output
0-0-0-0
1-1-1-1
2-4-8-16
.
.
.
25-625-15625-390625

2. Write a program that reads in a number N and then outputs the sum from 1 to N.
if the input is 3, the output should be 14 because 1^2+2^2+3^2=1+4+9=14

I need it right away tommorow, please attach the source code. Maraming salamat!
Do your own homework.
I need it right away tommorow, please attach the source code. Maraming salamat!


Not even polite more like some command?
Here the first part:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <iostream>
#include <stdlib.h>

using namespace std;

int main(int argc, char *argv[])
{
  cout<<    "0	0	0	0\n"
            "1	1	1	1\n"
            "2	4	8	16\n"
            "3	9	27	81\n"
            "4	16	64	256\n"
            "5	25	125	625\n"
            "6	36	216	1296\n"
            "7	49	343	2401\n"
            "8	64	512	4096\n"
            "9	81	729	6561\n"
            "10	100	1000	10000\n"
            "11	121	1331	14641\n"
            "12	144	1728	20736\n"
            "13	169	2197	28561\n"
            "14	196	2744	38416\n"
            "15	225	3375	50625\n"
            "16	256	4096	65536\n"
            "17	289	4913	83521\n"
            "18	324	5832	104976\n"
            "19	361	6859	130321\n"
            "20	400	8000	160000\n"
            "21	441	9261	194481\n"
            "22	484	10648	234256\n"
            "23	529	12167	279841\n"
            "24	576	13824	331776\n"
            "25	625	15625	390625\n";
  system("PAUSE");	
  return 0;
}
^^^ lol

@teddy16
If you want people on the internet to do your homework, they WILL do it the troll way.

Although the fourth column definetly would look better in octal...
Last edited on
thats not a homework, I just need it for my friend.
His homework? :P
her homework..
Topic archived. No new replies allowed.