Re: [Dev-C++] new comer to the world of Dev-C++
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ferdinando F. <s2...@st...> - 2003-12-02 10:05:42
|
On Mon, 1 Dec 2003, hmbayati wrote:
> #include <iostream.h>
>
As others told, you should use <iostream>, or (at least in Dev-C++5)
you'll have a warning for antiquated header. So:
#include <iostream>
using namespace std;
> void square()
Should it be int main ()?
> {
> cout << "hello, you are now in hadi's program.\n";
> int num;
>
> cout << "enter a number and I will give you its square.\n";
>
> cin >> num;
>
> cout << "the square of " <<num<<" is : "<<num * num << endl;
>
> return;
> }
>
if you don't see any result, it could be that you need to wait for an
input, adding a final cin.get () before returning, as others suggested in
another post, because you compiled a program for console, and when you
make it run in a window it close it immediately on returning. Or you can
execute your program really in a console (starting cmd.exe).
Ferdinando
|