Assignment Details

Program #1 - Powers of

Academic Year 2018/19

1s Period Robotics Tue/Thur

Date Due

Dec. 6, 2018

Additional Info
Write a program to find the value of one number raised to the power of another.
Hint 1** Two numbers are entered through the keyboard.***
Hint 2** Use a for loop**

*******Result****
#include <iostream>

using namespace std;

int main(){
int base, pow;
int result=1;
cout<<"Enter a base and a expo: \n";
cin>>base>>pow;
for (int a=1; a<=pow;a=a+1){
// power formula
result=result*base;
}
cout<<"The result is: "<<result;
return 0;
}