0
Write a condition in if statement to get output as "HELLOWORLD"
if(_____) { cout<<"HELLO"; } else { cout<<"WORLD"; }
4 odpowiedzi
+ 1
using this syntax, you will not be able to output both conditions, since it will run only one of the two then finish. For example if the condition was if (true), it would ONLY run HELLO.
You could put it into a loop like this:
bool foo = true;
while (true) {
if (foo)
cout << "HELLO";
else {
cout << "WORLD";
break;
}
+ 1
Oh, you already know your own question. Well, I have no idea then. I give up
0
no there is a way out... try harder😝
0
no...wrong answer
you just need to give a condition to if statement