Tuesday, 25 August 2015

Write a program that reads in two numbers and adds them together

#include"stdafx.h"
#include<iostream>
usingnamespace std;
int main ()
{
int x,y,z;
cout<<"Enter the value of x:";
cin>>x;
cout<<"Enter the value of y:";
cin>>y;
z=x+y;
cout<<"By adding x and y we get "<<z<<endl;
system("pause");
}

No comments:

Post a Comment