View Single Post
Old 10-08-2007, 04:13 PM   #16 (permalink)
Garbage
God of Mistakes...
 
Garbage's Avatar
 
Join Date: Dec 2005
Location: Pune, Maharashtra
Posts: 1,923
Default Re: C++:Adding two numbers

Let me post a good ANSI C++ Program ...

Code:
# include <iostream>
using namespace std;
int main()
{
    int a,b,c;
    cout << "Enter two numbers : ";
     cin >> a >> b;
    
    c = a + b;
    
    cout << "Addition = " << c << endl ;
    
    system ("PAUSE");
    return 0;
}
This is compiling perfectly on Dev C++

@ Ron

Let me tell u bro, the newer versions, there is no need to use ".h" in names of header files. If u use them, they are considered as backward headers.

But, if u r using OLD TC3 compiler, then it should be there.
Also using namespaces std; will NOT work in that compiler.

Better to go for new standards. U my try Dev C++
__________________
Registered Linux User #468778
----------------------------------
http://twitter.com/_Garbage_

Last edited by Garbage; 10-08-2007 at 04:13 PM. Reason: Automerged Doublepost
Garbage is offline