Why the answer is 9 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Why the answer is 9

Can you explain why? #include <stdio.h> int main() { int x = 9; x %= 11; printf("%d",x); return 0; } Answer: 9 https://code.sololearn.com/cQCc76YT7plT/?ref=app

12th Aug 2020, 3:09 AM
Christian M. De Los Santos
Christian M. De Los Santos - avatar
2 Answers
+ 12
When we apply % (modulo) operator b/w two operands, if the first operand is less then the second it directly gives the first operand has our answer The same is happening here 9%11=9 (since 9<11 it directly gives 9 has the answer) I hope u will understand!!
12th Aug 2020, 3:14 AM
chaithra Gowda
chaithra Gowda - avatar
+ 1
Ahh okay thank you Chaithra Gowda👑
12th Aug 2020, 3:19 AM
Christian M. De Los Santos
Christian M. De Los Santos - avatar