Programas De C++

Páginas: 8 (1759 palabras) Publicado: 3 de junio de 2012
//programa 1
#include<iostream>
#include<string>
using namespace std;
main ()
{
Int c=1;
While (c<=10)
{
cout<<c<<endl;
c=c+1;
}
system (“pause”)
return 0;
}
//programa 2
#include<iostream>
#include<string>
using namespace std;
main ()
{
Int c=1
Do
{
Cout<<c<<endl;
C=c+1;
}
While (c<=10);
System(“pause”);
Return 0;
}
//programa 3#include<iostream>
#include<string>
using namespace std;
main ()
{
Int c
for (c=50; c<=100; c=50+1)
{
cout<<c<<endl;
}
system (“pause”);
return 0;
}
//programa 4
#include<iostream>
#include<string>
using namespace std;
main ()
{
Int c;
For (c=2; c<=100; c=c+2)
{
Cot<<c<<endl;}
system(“pause”);
Return 0;
}
//programa 5
#include<iostream>#include<string>
using namespace std;
main ()
{
Int c=2
While (c<=100)
{
Cout<<c<<endl;
C=c+2;
}
System(“pause”);
Return 0;
}
//programa 6
#include<iostream>
#include<string>
using namespace std;
main ()
{
Int c=2;
Do
{
Cout<<c<<endl;
C=c+2;
While (c<=100);
System(“pause”);
Return 0;
}
//programa 8
#include<iostream>
#include<string>
usingnamespace std;
main ()
{
Int c, N, s=0;
For (c=1; c<=10; c++)
{
Cout<<”proporcione un numero:”<<endl;
Cin>>N;
S=s+N;
}
Cout<<”la suma total es:”<<s<<endl;
System(“pause”);
Return 0;
}
//programa 9
#include<iostream>
#include<string>
using namespace std;
main ()
{
Int c=1,N;
Float calif, prom,s=0;
Cout<<”proporcione el total de unidades en elsemester:”<<endl;
Cin>>N;
While (C<=N)
{
Cout<<”proporcione la calificacion de la unidad:”<<endl;
Cin<<clif:
S=s+calif;
C=c+1;
}
Prom=s/N;
Cout<<”su promedio es:”<<prom<<endl;
System(“pause”);
Return 0;
}
//programa 10
#include<iostream>
#include<string>
using namespace std;
main ()
{
Int c=1, R;
While(c<=10)
{
R=2*c;Cout<<”2”<<”*”<<c<<”=”<<R<<endl;
c=c+1

}
System(“pause”);
Return 0;
}
//programa 11
#include<iostream>
#include<string>
using namespace std;
main ()
{
Int R, c=1,N;
Cout<<”elija la table:”<<endl;
Cin>>N;
While (c<=10)
{
R=N*c
Cout<<N<<”*”<<c<<”=”<<R<<endl;
C=c+1;
}
System(“pause”);
Return 0;
}
//programa 12#include<iostream>
#include<string>
using namespace std;
main ()
{
Int c1=1, c2, R;
While (c1<=5)
{
C2=1;
While (c2<=10)
{
R=c1*c2;
Cout<<c1<<”*”<<c2<<”=”<<R<<endl;
C2=c2+1;
}
C1=c1+1;
}
System(“pause”);
Return 0;
}
//programa 13
#include<iostream>
#include<string>
using namespace std;
main ()
{
Int N,c=1,E, prom, s=0;Cout<<”numero de alumnus:”<<endl;
Cin>>N;
While (c<=N)
{
Cout<<”proporcione la edad del alumno:”<<endl;
Cin>>E;
S=s+E;
C=c+1;
}
Prom =s/N;
Cout<<”la edad promedio es:”<<prom<<endl;
System(“pause”);
Return 0;
}
//programa 14
#include<iostream>
#include<string>
using namespace std;
main ()
{
Int c1=1, c2, R, NT;
Cout<<”elija hasta que la tablequiere que el imprima:”<<endl;
Cin>>NT;
While (c1=NT)
{
C2=1;
While (c2<=10)
{
R=c1*c2;
Cout<<c1<<”*”<<c2<<”=”<<R<<endl;
C2=c2+1;
}
C1=c1+1;
}
System(“pause”);
Return 0;
}
//programa 15
#include<iostream>
#include<string>
using namespace std;
main ()
{
Int N, c=1, SP=0, SN=0, SNE=0;
While (c<=25)
{
Cout<<”proporcione unnumero:”<<endl;
Cin>>N;
If (N>0)
{
Cout<<”el numero es positive”<<endl;
Sp=sp+1;
}
Else
{
If (N<0)
{
Cout<<”el numero es negativo”<<endl;
SN=SN+1;
}
Else
{
Cout<<”el numero es neutro”<<endl;
SNE=SEN+1;
}
}
c=c+1;
}
Cout<<”la suma de los números positivos es:”<<SP<<endl;
Cout<<”la suma de los números negativos...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Programa c#
  • PROGRAMAR EN C
  • C++ Programas De C++
  • Programas en c++
  • programa en c++
  • Programas c#
  • programas en c
  • Programas en c

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS