I'm a really newbie to programming so sorry if this is a silly question. But why does my code produce 1 less for 5^2 and for all multiples of 5 eg 5^2=24 and 10^2=99.
Code:#include <iostream> #include <stdio.h> #include <math.h> using namespace std; int main () { int y=0, sum=0 ; for ( int x=1 ; x<21 ; x++){ int y= pow(x,2); sum += y; cout << "x=" <<x<<endl; cout << "y=" <<y<<endl; cout << "sum=" <<sum<<endl; } }