Online Compiler C

#include <stdio.h> int main(void) { int a, b, sum; scanf("%d%d", &a, &b); for(int i = a; i <= b; i++) { sum+= i * i; } printf("%d", sum); return 0; }
1) This code calculates the sum of squares of all integers from `a` to `b` inclusive, where `a` and `b` are provided by the user.

2) Hint: The variable `sum` is not initialized before being used in the loop, which leads to undefined behavior.  
Hint: Consider what happens if the user inputs a value for `a` that is greater than `b`—the loop condition `i <= b` may not execute as intended.