Hello guys... Usually I am visiting this site to get some nice hacks , or to read some nice discussions... but this time it is different... I have one big problem. I had to make project on "C" programming language for the university... but when I gave it to the teacher... he told me that he will let me pass only if i fix this program:
cin >> n;
if (n < 0) return 1;
int sum = 0;
int i = 0;
while (i <= n) sum += i*i;
cout << sum;
I have no idea how to fix it .. it seems ok to me . Please someone that is fammiliar with "C" programming language help me ! If i dont fix this program I won't pass... Please fix it guys !
Sorry that I am bothering you with this kind of things... but I dont know who else to ask
Thanks in advance ! Big thanks!