-28. Sum of Squares with Recursion

user_6817964 avatar
user_6817964
c_cpp
01/02/2023 12:03 PM
172 B
16
Indexable
int main() {
	int n, sum = 0;
	scanf("%d", &n);
	for (int i = 1; i <= n; i++) {
		sum += i * i;
	}
	printf("%d", sum);
}
Editor is loading...