ClubEnsayos.com - Ensayos de Calidad, Tareas y Monografias
Buscar

Codigos de programacion.


Enviado por   •  23 de Septiembre de 2016  •  Trabajos  •  5.486 Palabras (22 Páginas)  •  241 Visitas

Página 1 de 22

PROGRAMACION

PROFESOR:

MIGEL TOVAR

TEMA:

C++

ESTUDIANTE:

DANIEL FRANCISCO QUINTERO MEDINA

COD: 20441416995

UNIVERSIDAD ANTONIO NARIÑO

INGENIERIA ELECTRONICA

2015

Taller Ciclos: 

1.  while cout:

#include

using namespace std;

#define SIN_TIPO string

int main() {

        float c;

        SIN_TIPO m;

        float ot;

        float rom;

        float sum;

        sum = 0;

        c = 1;

        cout << "Digite su nombre" << endl;

        cin >> m;

        while (c<=6) {

                c = (c+1);

                cout << "Digite su calificacion" << endl;

                cin >> ot;

                sum = sum+ot;

        }

        rom = sum/6;

        cout << "El alumno  " << m << " tiene un promedio de: " << rom << endl;

        return 0;

}

2.  while cout:

#include

using namespace std;

int main() {

        float cuarta;

        float cubo;

        float n;

        float num;

        n=1;

        while (n<=10) {

                n=(n+1);

                cout<<"Digite un numero"<

                cin>>num;

                cubo=num*num*num;

                cuarta=cubo*num;

                cout<<"Cubo:"<

        }

        return 0;

}

3.  while cout:

#include

using namespace std;

int main() {

        float nom;

        float x;

        x = 1;

        while (x<=10) {

                x = (x+1);

                cout << "escriba los numero:" << endl;

                cin >> nom;

                if (nom>0) {

                        cout << "el numero positivo es:" << nom << endl;

                }

        }

        return 0;

}

4.  while cout:

#include

using namespace std;

int main() {

        float cn;

        float cneg;

        float cp;

        float j;

        float nu;

        cn = 0;

        cp = 0;

        cneg = 0;

        j = 1;

        while (j<=20) {

                j = (j+1);

                cout << "escibir numeros:" << endl;

                cin >> nu;

                if (nu==0) {

                        cn = cn+1;

                } else {

                        if (nu>0) {

                                cp = cp+1;

                        } else {

                                cneg = cneg+1;

                        }

                }

        }

        cout << "los numeros positivos que hay son:" << cp << endl;

        cout << "los numeros neutros que hay son:" << cn << endl;

        cout << "los numeros negativos que hay son:" << cneg << endl;

        return 0;

}

5.  while cout:

#include

using namespace std;

int main() {

        float n;

        float nu;

        float pos;

        n = 1;

        while (n<=15) {

                n = (n+1);

                cout << "digite numeros:" << endl;

                cin >> nu;

                pos = nu*(-1);

                cout << "el numero positivo de:" << nu << "es:" << pos << endl;

        }

        return 0;

}

6.  while cout:#include

using namespace std;

int main() {

        float baja;

        float calf;

        float media;

        float n;

        float sum;

        sum = 0;

        baja = 9999;

        n = 1;

        while (n<=40) {

                n = (n+1);

                cout << "escriba calificaciones:" << endl;

                cin >> calf;

...

Descargar como (para miembros actualizados)  txt (12.9 Kb)   pdf (114.7 Kb)   docx (303.8 Kb)  
Leer 21 páginas más »
Disponible sólo en Clubensayos.com