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

Codigos de programacion.

jhons06Trabajo23 de Septiembre de 2016

5.486 Palabras (22 Páginas)302 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;

                sum = sum+calf;

                if (calf

                        baja = calf;

                }

        }

        media = sum/2;

        cout << "la calificacion media es:" << media << endl;

        cout << "la calificacion baja es:" << baja << endl;

        return 0;

}

7.  while cout:

#include

using namespace std;

int main() {

        int num,resu,x;

        cout << "digite numero:" << endl;

        cin >> num;

        x = 0;

        while (x<=10) {

                x = (x+1);

                resu = num*x;

                cout << "" << num << "*" << x << "=" << resu << endl;

        }

        return 0;

}

8.  while cout:

#include

using namespace std;

int main() {

        int h,m,s;

        h = (-1);

        while (h<=23) {

                h = (h+1);

                m = (-1);

                while (m<=59) {

                        m = (m+1);

                        s = (-1);

                        while (s<=59) {

                                s = (s+1);

                                cout << "hora: " << h <<"   minutos: " << m << "  segundos: " << s << endl;

                        }

                }

        }

        return 0;

}

1.  while printf:

#include

#include

using namespace std;

#define SIN_TIPO string

int main() {

        float c;

        float ot;

        float rom;

        float sum;

        sum = 0;

        c = 1;

        while (c<=6) {

                c = (c+1);

                printf ("Digite su calificacion:");

                scanf ("%f",&ot);

                sum = sum+ot;

        }

        rom = sum/6;

        printf ("El alumno tiene un promedio de:%f ", rom );

...

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