Code: Select all
//My fourth programm in C++
#include<iostream>
using namespace std;
int main()
{
int x,y;
char name;
cout<<"Please enter you name :- "<<endl;
cin>>name;
cout<<"hello "<<name;
cout<<"we are going to test addition"<<endl;
cout<<"Please enter a number 1 = "<<endl;
cin>>x;
cout<<"Please enter a number 2 = "<<endl;
cin>>y;
cout<<"number 1 + number 2 = "<<x+y<<endl;
system("pause");
}
1.I wanna get the user name.That's why I used variable as "name" & wanna get the print out as "hello ............."(ex-hello g-sparkz)
2.then I wanna run my adding system.
Errors-
- I get user in put window,I can enter a name also.But Don't get any name out put in "hello .........."line.Just one letter disply.
- code run with out errors when I compile.But not working properly after entering the name.it don't ask for any number input.