Jeff Verdegan wrote:
Chaturaka Gunatilaka wrote:Can you give me the code of that?I've tried but failed to solve.
That's not how it works. If you show your work and TellTheDetails(←click) of what went wrong, people will be happy to guide you toward solving your own problem.
ok then.
import java.math.BigInteger;
public class AWords{ public static void main(
String[]args){
BigInteger sum=null; //BigInteger sum=new BigInteger(null);
for(int i=1;i<=1000;i++){
sum = sum.
add(Math.pow(i, i));
System.out.println(sum);
}
}
}
So this is what I've done.but I got an error saying
Exception in
thread "main" java.lang.Error: Unresolved compilation problem: The method add(BigInteger) in the type BigInteger is not applicable for the arguments (double) at AWords.main(AWords.java:5)