My Frist Program

#include <iostream.h>
main()
{
int a,b;
cout<<"Frist Number:";
cin>>a;
cout<<"Second Number";
cin>>b;
int sum;
sum=a+b;
cout<<"Result is="<<sum;
getch()
}
Didn't it give you a compiler error?
That's nice, fasih, but...

1. What's a "Frist" program?
2. As the above poster asked, how the hell did you not get a compiler error?
3.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <iostream>

int main(int argc, char* argv[])
{
    int a, b;
    
    std::cout << "First number: ";
    std::cin >> a;
    std::cout << "Second number: ";
    std::cin >> b;

    std::cout << "Result: " << (a+b) << std::endl;
    
    std::cin.get();
    std::cout << "Press <ENTER> to continue...";
    std::cin.get();

    return 0;
}
Topic archived. No new replies allowed.