0
What is this called and its uses?
int even = 0, odd = 0; for(int i = 1; i<=100;i++){ even += (i%2==0)? i : 0; odd += (i%2==0)? 0 : i; } what is the "(boolean)? value : value;" called and what else can it be used for? I understand that if boolean is true it uses the value to the left of the colon and to the right if false.
4 Respuestas
+ 1
This kind of condition is called " operator condition"
0
If the between parentheses check the condition, it gives a left value and if it does not take the right, then what is the problem?
0
Mohammed Mizory is that all it does?
Also what is this thing called?
0
Oh ok thanks Mohammed Mizory