its telling me it has errors but i dont know how to fix it
#include <iostream>
#include <cmath>
using namespace std;
int main ()
{
int a,b,choice;
int sqr(int a);
int sqrRoot(int a);
double result;
while(true)
{
cout<<"enter a number"<<endl;
cin>>a;
cout<<"whould you like to see the (1) square, (2) square root, (3) is the number odd or even or (4) exit"<<endl;
cin>>choice;
if(choice==4)
switch(choice)
{
case 1:
result=sqr(a);
cout<<"the square of "<<a<<" is "<<b<<endl;
cout<<endl;
break;
case 2:
result=sqrRoot(a);
cout<<"The square root of "<<a<<" is "<<b<<endl;
break;
case 3:
if ( a % 2== 0 )
cout << a << " is even "
<<endl;
else
cout << a << " is odd "
<<endl;
}
}
system ("pause");
return 0;
}
int sqr(int a)
{
int b;
b=a^2;
return b;
}
int sqrRoot(double a)
{
double b;
b=sqrt(a);
return b;
}
@sherre02: it is against this community's agreed-upon rules to post full solutions to questions of this nature. We're here to help people learn, not to hand out free solutions.