0
C++ separate if
So I’m wondering how to seperate if statements so i could input something like Hi then input something different and get a different answer
2 Antworten
0
Separate the if with an else-if statement and check if another condition is met.
if (!str.compare("Hi"))
std::cout << "Hello\n";
else if (!str.compare("Hello"))
std::cout << "Hi\n";
else
std::cout << "Greetings\n";
0
ok thanks