New course! Every coder should learn Generative AI!
Try a free lesson0
It's working fine. May be your confusing in entering the details.. getline reads entire line. So use all cin for clarity... Like
cout<<"Enter name:"<<endl;
cin>>name;
cout<<"Account no:"<<endl;
cin>>acno;
cout<<"Account type:"<<endl;
cin>>actype;
cout<<"Opening balance:"<<endl;
cin>>bal;
Now it's easy for you enter values just by space separating or in new line.. And take care cin takes only reads a word of input only..