+ 7
Maths challenge-calculator not useful
Can you find the reminder of the number (2222^5555+5555^2222) during the division with 7?? NOTE: 1. "^" is the symbol for power; 2. If you calculate it directly, the reminder will be 0, because the computer names it as infinite (and the division with every number will be evaluated 0); 3. It is useful to solve it using programming. 1...2...3...START ;)
54 Réponses
+ 6
100% correct ^ is bitwise operator lol..
Updated code
+ 5
u mean like this
https://code.sololearn.com/cjdi2c6FZ0RY/?ref=app
+ 5
hows that? answer (3)
+ 5
possible!
+ 5
mmhmmm it is a tricksy one
+ 5
lol, so long division
+ 5
not yet, went to pick up the missus. But thought about it whilst I was out.. well u pretty much gave away how to do it ;)
+ 5
Hang on, you saying the result you have is 0?
+ 5
Yes @Jay It's output is 0 (Ruby)
+ 5
sooooo... doing it directly does work. fine
very misleading
+ 4
ok.. not sure i understand then
+ 4
last try.. i got 1 with changing it to what u typed exactly above
+ 4
I saw it
+ 4
I think i know what the problem is..
I believe it is not correct to write 2^3 to evaluate the power of 2 in c++
+ 4
I tried 3^5 and its output was 6
+ 4
You can use math.h library
and pow(a,b) instead...
+ 4
yes
+ 4
#Ruby
ans = (2222**5555+5555**2222) % 7
puts ans
#Is I am right ?