Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis0
3+2+1-5+4%2-1/4+6
The answer is 7, i dont get it. Can someone show me step by step how to get it?
4 Respostas
+ 9
3+2+1-5+4%2-1/4+6
modulus and division operator has higher priority so
4%2=0 and 1/4=0
then
3+2+1-5=1
4%2=0
-1/4=0
so now only 1+6 which is equal to 7
so output is 7
0
Nope it won't be 7.In programming there are some function that can wrap this float number and give result in integer. I think š
0
-1/4=0? What?š
0
If all numbers are in floating point, then ans will be 6.75. Figured it out thx guys. Seems floating point will be more accurate.