Help

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)



chenejm wrote:
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)


Ok, done. What else should I do?
You're not going to get answers without questions.

Angela the Herbalist wrote:
Of course I'll tell you! All you have to do is ask.


Of course she never wrote this because she doesn't exist.
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
Last edited on
OP, what do you mean three numbers? Are they angles? What unit?

And the cout line question:
cout << "saying goes like this..." << endl;
Also, use #include <iostream> .
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".

whats wrong am doing? :/
Last edited on
@freakinghell: DON'T hijack threads. Start a thread of your own for your own question. Also: Use code tags: http://cplusplus.com/articles/z13hAqkS/
<iostream.h> works fine. I use it myself. Depending on which compiler you are using.
Don't need to use 'using namespace std';

some use particular MVC++ this:
<iostream>
using namespace std;

I using Borland C++ ver 5.03 and above won't work on that one but works fine on MVC++.

If you use getch() include <conio.h>
Hope this help.
Last edited on
closed account (z05DSL3A)
freakinghell,

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?

It ran on including <conio.h>.

@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.

@webjose: would remember from next time, thanks.

thank you Perman and morecm.
Topic archived. No new replies allowed.