Help with C++ prorgram

Hey guys, ok this is my problem:

Calculate the exponential power nn.
Program prompts user to input a positive integer n less than 10.
Program terminates if invalid number is entered.
Program then calculates the exponential power using for loop.
Finally, outputs all the preceding steps (product) leading to the result.

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
  and this is the code i have so far:

#include <iostream>
using namespace std;
int main(){

int c=1,n, total;

cout<<"Please enter a possitive interger, less than 10: ";
cin>>n;

for(n=1;n<=10;){
        for(c=1; c<=n; c++){
        total=c*n;
        cout<<n<<" ^ "<<c<<" = "<<total<<endl;
        c+=1;
}

return 0;
}
}








I feel like I have the key components but they're either not arranged correctly or i'm missing one piece.
you get N from the user but then you set N = 1 in line 12. Why get N from user ?

Seems like you have some logic or naming problems.
Topic archived. No new replies allowed.