The mistake is that you work on random numbers.
Look at your code. You assign number and exponent from n and e before you even have got the input.
Below the assignment was moved after the input. This works.
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
int n;
int e;
cout << "Enter base number " <<endl;
cin >> n;
cout << "Enter exponent number "<< endl;
cin >> e;
cout << "Base number is" << n << endl;
cout << "Exponent is" << e << endl;
{
double number = n;
double exponent = e;
cout << pow(number, exponent) <<endl;
}
return 0;
}
But keep in mind that this is the wrong forum to ask newbie questions about the C++ language. Therefore this question is off-topic and the thread will be locked soon.
Ask these questions in a forum dealing with the C++ language.
Code::Blocks is only an IDE and not the compiler that's responsible for building the program.
Hope that helps,
pirx67