Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
c++ CUCEI TAREA
#include <iostream> //Del 1 al 10 utilizando el ciclo for
#include <conio.h>
#include<stdio.h>
using namespace std;
class For {
public :
void sumar();
};
void For::sumar()
{
int n , suma =0;
for(n=1;n<=10;n++)
{
cout<<n<<"+";
suma==suma+n;
if (n==10)
cout<<"\b="<<suma;
}
cout<<"\n\n\n\n LA suma del 1 al 10 es:"<<suma;
}
main()
{
For objeto;
objeto.sumar();
getch();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.