Jul 13, 2012 at 5:06am
hi,this is my first post. would you help me ?
while compiling, there's msssages said that :
error : stray '\1' in program.
what is that mean ?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
#include <iostream>
#include <conio.h>
#include <math.h>
using namespace std;
class PersamaanKuadrat
{
public :
float A, B, C;
void input()
{
cout << "input nilai A:";
cin >> A;
cout << "input nilai B:";
cin >> B;
cout << "input nilai C:";
cin >> C;
cout << endl;
cout << "persamaan kuadrat : "<< A << "x^2 + (" << B <<")x + ("<< C <<")";
}
float determinant()
{
float det;
det=sqrt((B*B)-4*A*C);
return det;
}
void akar ()
{
float X1, X2, det;
det = determinant();
X1= (-B + det)/2*A;
X2= (-B - det)/2*A;
cout<<"akar-akar persamaan tersebut adalah "<< X1 <<" dan "<< X2 <<endl;
}
};
int main ()
{
PersamaanKuadrat O;
O.input ();
O.determinant();
O.akar();
getch ();
return 0;
}
|
Last edited on Jul 15, 2012 at 2:59am
Jul 13, 2012 at 5:11am
Usually when one requires help debugging code, they display the code...
Jul 13, 2012 at 5:28am
wait..
there's also SOH post in the line that makes the messages appear. what is that mean ?
Jul 13, 2012 at 5:37am
It makes it easier for people to debug your code if you post it.
It would also be good to screenshot or copy/paste your error code.