i want to make a program that asks the user if he is old or young and depends on the answer the program will go in a certain route using if else-if.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#include <iostream>
usingnamespace std;
int main()
{
int x;
char young, old;
cout<<"Are you feeling young or old?\n";
if(cin>>young)
{ //the rest is going well so i wont write it
}
elseif(cin>>old)
{ //the rest }
else
{ cout<<"bad boy"}
it seems that whatever i write , the program always go to young and run its code