My program is not taking input of "Enter Your Name : " - Help Please.!

I am beginner … please help me … I am unable to complete this task because … my program is not taking input of "Enter Your Name : "

#include<bits/stdc++.h>
using namespace std;

void form_fillup_function(int form_fillup){
if(form_fillup==1){
cout<<“Fill up the form carefully”<<endl;
// Personal Details
char your_name[100],father_name[100],mother_name[100];
cout<<"Enter your name : ";
cin.getline(your_name,100);

    cout<<"Enter your father's name : ";
    cin.getline(father_name,100);
    
    cout<<"Enter your mother's name : ";
    cin.getline(mother_name,100);
    
    int mobile_number;
    cout<<"Enter mobile number : ";
    cin>>mobile_number;
    
    srand(time(NULL));
    int OTP=(rand()%900000)+100000;
    cout<<"Your OTP is : "<<OTP<<endl;
}
else{
    cout<<"You entered wrong input. Try again."<<endl;
    cout<<"Enter 1 to fill up form :";
    int form_fillup;
    cin>>form_fillup;
    form_fillup_function(form_fillup);
}

}

void creat_account_function(int creat_account){
if(creat_account==1){
cout<<“Welcome to Our Bank.”<<endl;
int form_fillup;
cout<<“Enter 1 to fill up form :”;
cin>>form_fillup;
form_fillup_function(form_fillup);
}
else{
cout<<“You entered wrong input. Try again.”<<endl;
int creat_account;
cout<<"Enter 1 to creat new Bank Account : ";
cin>>creat_account;
creat_account_function(creat_account);
}
}

int main(){
int creat_account;
cout<<"Enter 1 to creat new Bank Account : ";
cin>>creat_account;
creat_account_function(creat_account);

return 0;

}

1 Like

For taking input from key board we use the cin<< not count<<

Actually I’m taking input of a string (line) so I used cin.getline();

Here, your_name is a char variable.

cout<<"Enter your name : ";
cin.getline(your_name,100);