Fandom

Scratchpad

PLE:Unidad3Ejercicio16

215,934pages on
this wiki
Add New Page
Discuss this page0 Share

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

/*
Programa:       Unidad2Ejercicio16.cpp
Descripción:    Suma los 20 primeros pares
*/
#include <iostream>
using namespace std;
void main ()
{
        int i=0, suma = 0, numPares=1;

        for(i = 0, numPares = 1; numPares <= 20; i+=2, numPares++)
        {
                cout << numPares << ',' << i << endl;
                suma += i;
        }

        cout << "La suma es = " << suma;

        cin.ignore();
        cin.get();
}

Also on Fandom

Random wikia