Original Post
Hello, the following is my exercise which i trying learn in c++ tutorial, here is the exercise: the compiler always giving me an error...! where is my wrong regards MFA
write a program that asks the user to input a real number n. Compute 3 n and output the result. Your program output should be formatted as follows:
Enter a real number: 7.12
7.12^3 = 360.944
Press any key to continue
here is my code:
#include <iostream>
#include <string>
using namespace std;
float main()
{
float n,a;
cout << "Enter a real number:";
cin >> n;
a=n^3;
cout << a << endl;
}