Hey,
It's been a very long time since i programmed and I have been using codeblocks with "C++ for dummies". I came across a program and decided, hey, I want to change it to do this:
It's the beginning of functions. I thought I'd like to take an input from a user and give the result instead of assigning set numbers. The code in the book is taking double to return a number with power of 3.
I wanted it to take the user input instead...I am able to get the first response but then it ends the program and displays inf with no chance of entering the second cin...
what am I missing?
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
int n;
int e;
double number = n;
double exponent = e;
{
cout << "Enter base number " <<endl;
cin >> n;
cout << "Enter exponent number "<< endl;
cin >> e;
}
cout << pow(number, exponent) <<endl;
return 0;
}