+ 2

What is the output of this code

int k, num=25; k = (num<10)?100:200; printf ("%d\n" , k);

1st Sep 2019, 11:41 AM
Anjali Kushwah
Anjali Kushwah - avatar
8 Respostas
+ 4
Sure
1st Sep 2019, 12:32 PM
Anjali Kushwah
Anjali Kushwah - avatar
+ 9
Did you need the output, or you wanted to know why the output is whatever it is? If you wanted to get the output, you could've run it in the code playground... 😁👍
1st Sep 2019, 12:12 PM
Oma
Oma - avatar
+ 4
Can you explain me?
1st Sep 2019, 11:45 AM
Anjali Kushwah
Anjali Kushwah - avatar
+ 4
Thanks
1st Sep 2019, 11:48 AM
Anjali Kushwah
Anjali Kushwah - avatar
+ 3
It's ternary operation equivalent If( num < 10) { k = 100;} else {k = 200;}
1st Sep 2019, 11:47 AM
id001x
id001x - avatar
+ 3
Please do not write a sentence in Relevant Tags, tags are used for search feature, and use of or existence of irrelevant words breaks the functionality. Hope you understand 👍 P.S. You can also use Code Playground to check for your doubt : )
1st Sep 2019, 11:49 AM
Ipang
+ 2
200
1st Sep 2019, 11:44 AM
id001x
id001x - avatar
+ 2
Welcome!
1st Sep 2019, 11:49 AM
id001x
id001x - avatar