Project Euler #6: Sum square difference

  • + 0 comments

    why my second case isn't executed? for(int a0 = 0; a0 < t; a0++){ int n; cin >> n; int sum=0; int sqsum=0; int sqaure;

        for(int i=1;i<=n;i++){
             sum+=i;
             sqaure =pow(sum,2);
             sqsum+=pow(i,2);
        }
        int diff=sqaure-sqsum;
         cout<<diff<<endl;
    }