Exponentials
To get 2 inputs from the user whose result is getting by using Exponentials:
Program:
#include < iostream >
using namespace std;
int main()
{
int a , b , p = 1;
cout << "Enter base = ";
cin >> a;
cout << "Enter Power = ";
cin >> b;
for (int k = 1; k <= b; k++)
{
p = p * a;
cout << "The result is = " << p << endl;
}
return 0;
}
Comments
Post a Comment