#include <iostream>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
usingnamespace std;
int main()
{
char str[25];
cout<<"Enter your First name:"<<"(Lower case please)"<<"\n";
gets(str);
int i=0;
if((str[i]=='a')&&( str[i+1]=='l')||(str[i]=='A')&&(str[i+1]=='L'))
{cout<<"Welcome Back Agent Memphis "<<"\n";
cout<<"Enter Your date of Birth and month to confirm your identity"<<"(Date/ Month-Enter Date first)"<<"\n";
int a,b;
cin>>a>>b;
if(a==25&&b==03)
{
cout<<"Details Correct"<<"\n";
cout<<"Step 1 of 3 Complete"<<"\n";
}
else
{
cout<<"You have entered incorrect details!"<<"\n";
exit(EXIT_SUCCESS);
}
int c;
cout<<"Enter the Last two digits of Your Phone number"<<"\n";
cin>>c;
if(c==66)
{
cout<<"Details Correct"<<"\n";
cout<<"Step 2 of 3 Complete"<<"\n";
}
else
{
cout<<"You have entered incorrect details!";
exit(EXIT_SUCCESS);
}
}
string email;
cout<<"Enter your email id:"<<"\n";
getline(cin,email);
return 0;
}
here's the output:
Enter your First name:(Lower case please)
alpha
Welcome Back Agent Memphis
Enter Your date of Birth and month to confirm your identity(Date/ Month-Enter Date first)
25
03
Details Correct
Step 1 of 3 Complete
Enter the Last two digits of Your Phone number
66
Details Correct
Step 2 of 3 Complete
Enter your email id:
Process returned 0 (0x0) execution time : 12.444 s
Press any key to continue.
it does not input the email from the user.it directly goes to the return statement.please help. if you have better codes then please comment below. thankyou