I have to write two files, one is a header and the other a file that calls that header to run the equation. The problem I am having is that I do not see a response.
Any help would be appreciated.
Header file named header.h
#include <iostream>
#include <iomanip>
using namespace std;
float power(float a, int n)
{
{
if (a==0);
return (0);
}
{
if(n==0);
return (1);
}
{
if (n>0);
return( a* power(a,n-1));
}
}
#include <iostream>
#include <iomanip>
#include "header.h"
int x;
int main(void)
{
float a;
int n;
cout << "Enter base as an integer: ";
cin >> a;
cout << "Enter exponent as an integer: ";
cin >> n;
#include <iostream>
#include <iomanip>
#include "header.h"
int x;
int main(void)
{
float a;
int n;
cout << "Enter base as an integer: ";
cin >> a;
cout << "Enter exponent as an integer: ";
cin >> n;
cout << "\nResult: " << power(a,n) ;
cin >> x; //if your on windows you might want a System("pause"); instead of this line
}