im new to c++, and im having trouble with functions, can someone please explain to me and maybe provide a fix to this code. thanks beforehand.
#include <iostream>
#include <math.h>
using namespace std;
int main ()
{
int pow(int, inr);
cout<<"Please enter your first number"<<endl;
cin>>firstnumber;
cout<<"Please enter your second number"<<endl;
cin>>secondnumber;
power= pow(firstnumber,secondnumber)
{
int power (int x, int y);
cout<<x<<endl;
cout<<y<<endl;
#include <iostream>
usingnamespace std;
int square(int);
//----------------------------------------
int main ()
{
int number;
cout << "Please enter a number" << endl;
cin >> number;
int squ = square(number);
cout << "Square of " << number << " is " << squ << endl;
system ("pause");
return 0;
}
//------------------------------------------
int square(int x)
{
return x * x ;
}