i am having a difficulty with this simple program. I am only a beginner so it is kinda hard for me to program this simple program:
program is supposed to ask user name, print it and aks for 3 numbers and add them up before printing the result.
the this is that when asked for name, if i input my first name and my family name, it does not work and bypasses the step of asking numbers:
the code is:
int main ()
char type ;
int a, b, c,d;
cout<<"Hello! What is your name?\n";
cout<<"Enter your name.\n"
cin>>type; // this is where the problem is..if there is a space between the 2 names, it does not work
cout<< "hello"<<type<<"please enter 3 numbers.";
cout<< "number 1\n";
cout<< "number 2\n";
cout<< "number 3\n";
cout<< "The answer is"<<d;