Pls help in writing the program
Hi,
I wrote a simple program that accepts name ,age from user.
i declared name as char and age as int.Somehow when it prompts the statement to ask the value from user something is happening.Meaning if i enter jacob as name it immediately displays the next statement as enter ur age and the coming out of the program.
can anyone psl tell why is this happening ?
#include<iostream.h>
int main(){
char name;
int age;
cout<<"enter ur name"<<endl;
cin>>name;
cout<<"enter ur age"<<endl;
cin>>age;
return 0;
}
somhow it is not taking long name as input to name field.Pls suggest some solution.
thanks
bsb77