Advertisement
AntonioVillanueva

Numero Triangular

Jul 16th, 2015
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. //compilacion g++ -std=c++11 -o Ejecutable Programa.cpp
  2. #include <iostream>
  3. using namespace std;
  4. int main (){
  5.     int Suma(0),N(0);  
  6.     do{
  7.         N=N+1;
  8.         Suma=Suma+N;
  9.         cout <<"N= "<<N<<",Suma= "<<Suma<<endl; //Control visual Proceso   
  10.     }while (N!=50);
  11.     cout <<endl<<"Muestra="<<Suma<<endl;//Resultado
  12. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement