+ 1
I am new, need help please.
Can someone explain to me why the output is 81? #include <iostream> using namespace std; int main() { int x = 21, y = 31, z; z = (x % 5) * 9 / (y % 6) * 9; cout << z; return 0; }
3 Antworten
+ 2
(21%5) * 9 / (31%6) *9
(1)*9 / (1)*9
9/1*9
9*9
81
0
Next time specify the language in the tags
0
https://www.sololearn.com/learn/CPlusPlus/1609/
Go to last part and open the comment section , there I had written detailed comment how operator precedence works.
Hope this helps ☺️☺️.