12345678910111213141516171819202122232425262728293031
#include <iostream> using namespace std; int print(int x){ int sum=0; for (int i=2; i<=x; i++) { if (i%2==0) { i*i; } sum+=i; cout << sum <<endl; } } int main(){ int n; cout << "Enter a number" <<endl; cin>>n; print(n); }
910111213
sum += i * i; } } cout << sum <<endl;