+ 2
What is the correction needed for this program?
3 Respuestas
+ 3
Hello, can you explain what you want the code to do?
So far I noticed error due to line 25 where add method was invoked, it should be add(p) instead of add(int p).
And in "add" method, line 8, you are using modulo operator on a float type, and furthermore assigning the remainder from modulo operation to an int type, which triggers error:
int d=n%10;
I guess modulo operator isn't compatible with floating point numbers (cmiiw).
(EDIT)
Java actually supports modulo operation on floating points types.
+ 3
I'm doing the voodoo prime on coding challenge in the learn box.
I understood the error in line 25 .
line 8: but in the voodoo challenge its the a long value of the decimal is required to fulfill that challenge. is there any other way in which i can extract the last numbers one by one and use the if method??
thanks for solving the doubts