+ 8

Can anyone please explain me how can output is 3??

https://code.sololearn.com/cK7TbEKcm9Xp/?ref=app

29th Mar 2021, 1:39 PM
Dhruva
Dhruva - avatar
6 Respostas
+ 5
Thank you so much.
29th Mar 2021, 1:45 PM
Dhruva
Dhruva - avatar
+ 4
Dhruva Pandya m = a m = 9 b < m => 3 < 9 => true so m = 3// m = b c < m => 12 < 9 => false so finally m is 3
29th Mar 2021, 1:43 PM
A͢J
A͢J - avatar
+ 4
Thank you so much Atul.
29th Mar 2021, 1:51 PM
Dhruva
Dhruva - avatar
+ 3
#include <stdio.h> int min(int a, int b, int c) { int m = a;//9 if (b< m)//3<9(true) { m = b;//m=3 } if (c< m)//12<3 (false){ m = c; } return m; } int main() { printf("%d", min(9, 3, 12)); }
29th Mar 2021, 1:45 PM
Atul [Inactive]
+ 3
Hope this helps you
29th Mar 2021, 1:45 PM
Atul [Inactive]
+ 3
My pleasure
29th Mar 2021, 2:41 PM
Atul [Inactive]