Piyush and magical park

can we write like this first if , then again if , then else if , then else , and at last again if condition . as i know i can write only else if condition after if condition , please clear my doubt…

Yes you can decide the flow of instructions as per your needs.

if after an if will be executed no matter what happens in the first if.

if( 5>2) cout<<“a”;
if(3>2) cout<<“b”;
else if(4>2) cout<<“c”;

output ab

sir here output will be abc naa??

oh sorry sir i have made a mistake , now my confusion is clear. thank u sir

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.