language: C++ 4.7.2 (gcc-4.7.2)
date: 906 days 10 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
 
/*Written by Sarfaraz Nawaz*/
 
#include <iostream>
 
using namespace std;
 
int main() 
{
        int input = 2;
        cin >> input;
        for (struct {int loop; int n; long result; } power = {0,input,1}; power.loop <= 10 ; power.loop++, power.result *= power.n )
        {
                cout << power.n <<"^" <<power.loop << "=" << power.result << endl;
        }
        return 0;
}