Write a program that when a user enters three numbers, the program will tell the user whether those three numbers can form a triangle. (Hint: use logic && operator)
Write a program that when a user enters three numbers, the program will tell the user whether those three numbers can form a triangle. (Hint: use logic && operator)
Hi, i'm trying to learn classes in C++ and i've got a problem. I was using wxDev-C++ but it wouldn't compile, so i'm using Turbo-C++ IDE as it's also used at my school.
here's the code i'm trying to run
#include<iostream.h>
using namespace std;
class HitmansClass()
{
public:
void coolSaying()
{
cout<<"saying goes like this..." endl;
}
};
int main()
{
HitmansClass HitmansObject;
HitmansObject.coolSaying();
return 0;
}
it gives an "error: statement missing" just before the word cout. what wrong i'm doing ?
edit- sorry for posting it here, my problem is fairly basic so didn't want to open a new thread
On using #include<iostream> it says "unable to open include file iostream"
it runs while using #include<iostream.h> however it doesn't show the result on screen, i tried to use getch (); just before return 0; but it gives error "fuction 'getch' should have a prototype".
The biggest problem that you are going to have is that one of the compilers is as old as the hills and is pre standard, the other is compliant with a standard (if not the current one). You will not be able to move between the two with any ease and will likely get confused.
Is there any reason why your school uses such an old compiler?
@Greywolf: I'm not sure why they prefer such old compiler, but you are right it creates lot of confusion. Different compilers, even the new ones, giving different results for same piece of code also doesn't help, atleast to noobs like me. Anyway, i'll have to stick to old Turbo.