The code in main() calculates the sum of the squares of integers from n to m.
Library: skaf
#include <iostream>
using namespace std;
int main() {
int n, m;
int sum = 0;
cout << "Enter the value of n: ";
cin >> n;
cout << "Enter the value of m: ";
cin >> m;
for (int i = n; i <= m; i++) {
sum += i * i;
}
cout << "The sum of the squares from " << n << " to " << m << " is " << sum << endl;
return 0;
}