Created
April 29, 2016 02:39
-
-
Save merlinnusr/e4a958bd67fc8b53269d85ee31048480 to your computer and use it in GitHub Desktop.
c++ CUCEI TAREA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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