simple addition programme !!!

im nt getting o/p i hav compiled in GCC compiler
1
2
3
4
5
6
7
8
9
10
11
12
#include<iostream>
using namespace std;
 int x,y,sum;
int main()
{

    cout<<"enter the values for which u want sum";
    cin>>x,y;
    sum=x+y;
    cout<<"the sum is "<<sum;
    return 0;
}
closed account (L1AkoG1T)
In line 8, shouldn't it be cin >> x >> y;?
ya but d programme still ain't executing !! :(
1
2
3
4
5
6
7
8
9
10
11
12
#include<iostream>
using namespace std;
 int x,y,sum;
int main()
{

    cout<<"enter the values for which u want sum";
    cin >> x >> y;
    sum=x+y;
    cout<<"the sum is "<<sum;
    return 0;
}

It is working as intendent, but see: http://www.cplusplus.com/forum/beginner/1988/
Last edited on
im nt getting output! im getting o/p screen when i enter the values it is nt taking the 2nd value after i type 1 value and press enter something is coming and then when i press the second value the o/p screen is disappearing !!1 plz help !!
Just follow the link, please.
Topic archived. No new replies allowed.