+ 7
why output is 123???
#include <stdio.h> int main() { if(0>1,2>21) printf("hello"); printf("123"); return 0; }
8 Answers
+ 5
𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 sorry i used slag language as i knew that this person understands this language, and no worries from next time i will use proper English, 👍👍👍👍👍👍👍👍👍
+ 5
If the 'if' condition was true it would print both
since it's not it moved to the next set of code and prints 123
+ 4
Bhai 1st expression if just baad wali execute nahi hogi as , if to false ho gaya hai, then 2nd
Printf("123");
Hi run hoga na answer 123
+ 4
Bro, 1st expression just after if statement will not be executed, as condition of inside if is false and then 2nd expression i.e. printf("123") will be executed and will produce answer, 123
+ 3
Here your if condition is working as or operator means if one condition is true then first printf will be execute . If(0>1,2<21) then here (2<21)its also True then first printf will be execute. Here in your case your both condition are false before comma and after comma so second printf will be execute and answer is 123
+ 2
Hi,
Because Condition of If was false. and next statement is print so it will print 123
This code is as below:
if(0>1,2>21) //Condition false
{
printf("hello");
}
//terminate this loop and execute next statement
printf("123");
so output is 123