#include <iostream>

using namespace std;

int main() {
    int N;
    int suma = 0;
    int i = 1;
    
    cout << "Ingrese N: ";
    cin >> N;
    
    while (i <= N) {
        suma += i;
        i++;
    }
    cout << "Suma acumulada hasta " << N << " es: " << suma << endl;
    
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: