We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
long n1=(n*(n+1)/2);
long n2=(n*(n+1)*(2*n+1))/6;
by using this formula it give wrong out put 10000
by using normal traditonl method using loop gives correct answer is there any one discuss on this .
Project Euler #6: Sum square difference
You are viewing a single comment's thread. Return to all comments →
long n1=(n*(n+1)/2); long n2=(n*(n+1)*(2*n+1))/6; by using this formula it give wrong out put 10000 by using normal traditonl method using loop gives correct answer is there any one discuss on this .