Created
February 5, 2016 18:26
-
-
Save batmantec/3dbd1fde9e5bf46899cd to your computer and use it in GitHub Desktop.
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> | |
using namespace std; | |
int superpower(int x, int y){ | |
int ox, save, count=1; | |
ox=x; | |
do { | |
save=x*ox; | |
x=save; | |
count++; | |
} while(count!=y); | |
return save; | |
} | |
int main(){ | |
int ox,x,y,count,save; | |
cout<<"This program calculates the exponential"<<endl; | |
cout<<"What is the number what you want to raise? "; | |
cin>>x; | |
cout<<"What is the exponential number? "; | |
cin>>y; | |
save=superpower(x,y); | |
cout<<"The exponential number is: "<<save; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment