Created
April 19, 2016 16:03
-
-
Save DiegoNaterasPonce/57d8e5a2f970a54533908222052ce3c1 to your computer and use it in GitHub Desktop.
#WSQ13 Exam2 Prog2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <iomanip> | |
using namespace std; | |
int superpower(int a, int b) | |
{ | |
int z=1, number=1; | |
do { | |
number=number*a; | |
z=z+1; | |
} | |
while (z<=b); | |
return number; | |
} | |
int main () { | |
int n1, n2, x; | |
cout <<"Give me the first number: \n"; | |
cin >> n1; | |
cout <<"Give me the second number: \n"; | |
cin >> n2; | |
x=superpower(n1,n2); | |
cout <<"The result is: " <<x<<endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment