this is my code till now, but the answer is coming out to be incorrect. What am I doing wrong? I am supposed to find out the difference between the sum of squares, and square of sum of first 100 natural numbers.
#include<iostream>
using namespace std;
int main(){
int sumOfSquare = 0;
for(int i=1; i<=100; i++){
i = i*i;
sumOfSquare += i;
};
int squareOfSum = 0;
for(int i; i<=100; i++){
squareOfSum +=i;
};
squareOfSum = squareOfSum * squareOfSum;
int difference = squareOfSum - sumOfSquare;
cout<<difference;
}