CPP
cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <iostream>
using namespace std;
int main()
{
int a;
cout<<"We'll calculate an integer raised to some power.\n";
cout<<"You'll have to enter an integer and an exponent(power) to that integer.\n";
/*Sir! My question is that how could I be able to make alert to screen in sololearn, so my audience could be able to understand what values are to input without reading the code.*/
do {
int i=0;
double x,y;
double r=1;
cout<<"\nEnter an integer: ";
cin>>x;cout<<x;
cout<<"\nEnter the exponenet to that integer: ";
cin>>y;cout<<y;
cout<<endl;
if (y>=0)
{
while (i!=y)
{
r*=x;
++i;
}
cout<<x<<"^"<<y<<" = "<<r;
}
else if (y<0)
{
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run