Skip to content

Instantly share code, notes, and snippets.

@merlinnusr
Created April 29, 2016 02:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save merlinnusr/e4a958bd67fc8b53269d85ee31048480 to your computer and use it in GitHub Desktop.
Save merlinnusr/e4a958bd67fc8b53269d85ee31048480 to your computer and use it in GitHub Desktop.
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