Hi,
I'm beginner and have problems by using function square from math.h
Compajler:
Borland C++ 5.5.1 for Win32
Code:
#include <iostream.h>
#include <math.h>
int main() {
float r,k,x,y,z;
//long z;
cout <<"Enter x:";
cin >> x;
cout << "Enter y:";
cin >> y;
if (abs(x) != abs(y)) {
cout << "Enter r:";
cin >> r;
cout << "Enter k:";
cin >> k;
z = (square(r) * k) / (square(x) - square(y));
cout << "Rezults: " << z << endl;
}
else {
cout << "Funkcija nije definisana za date vrijednosti x i y \n";
return 0;
}
}
Compile Error:
Error E2268 Call to undefined function 'square'in function main()
Where I'm wrong?
I'm beginner and have problems by using function square from math.h
Compajler:
Borland C++ 5.5.1 for Win32
Code:
#include <iostream.h>
#include <math.h>
int main() {
float r,k,x,y,z;
//long z;
cout <<"Enter x:";
cin >> x;
cout << "Enter y:";
cin >> y;
if (abs(x) != abs(y)) {
cout << "Enter r:";
cin >> r;
cout << "Enter k:";
cin >> k;
z = (square(r) * k) / (square(x) - square(y));
cout << "Rezults: " << z << endl;
}
else {
cout << "Funkcija nije definisana za date vrijednosti x i y \n";
return 0;
}
}
Compile Error:
Error E2268 Call to undefined function 'square'in function main()
Where I'm wrong?
Comment