loll

0 Divulger Michealson · August 16, 2015
int main()
{
    string nam;
    char sex;

    cout<<"Are you a male or female 'M/F': ";
    cin>>sex;

    if(sex=='M'||sex=='m'){

    cout<<"Enter your name Sir: ";
}else if(sex=='F'||sex=='f'){
    cout<<"Enter your name Mam: ";
}else{
    cout<<"Invalid Response!!!\n";
}

    cin>>nam;
    if(nam=="Jordon"||nam=="jordon"&&sex=='M'||sex=='m'){
        cout<<"Welcome Mr."<<nam<<endl;
    }else if(nam=="Jorgina"||nam=="jorgina"&&sex=='f'||sex=='F'){
        cout<<"Welcome miss."<<nam<<" but you not the chosen one"<<endl;
    }else{
         cout<<"Welcome Mr."<<nam<<" but you not the chosen one bye"<<endl;
    }
    return 0;
}

Post a Reply

Replies

Oldest  Newest  Rating
+1 Alan Johnson · August 16, 2015
?
  • 1

C++

107,058 followers
About

Used in many types of software including music players, video games, and many large scale applications.

Links
Moderators
Bucky Roberts Administrator