while

BY
JOSE MIGUEL BRICEÑO
WWW.M3TALIJOX.ES.TL

/* usar while para calcular 3 notas de algunos estudiantes*/

#include<iostream.h>
void main()
{
    float n1,n2,n3,pt;
    char Nom[20],CI[10],resp='S';
    while(resp=='S'|| resp=='s')
    {
    cout<<"ingrese nombre:";
    cin>>Nom;
    cout<<"ingrese cedula de identidad:";
    cin>>CI;
    cout<<"ingrese primera nota:";
    cin>>n1;
    cout<<"ingrese segunda nota:";
    cin>>n2;
    cout<<"ingres tercera nota:";
    cin>>n3;
    pt=(n1+n2+n3)/3;
    cout<<"el promedio total es:"<<pt<<endl;
    cout<<"desea continuar? S/N";
    cin>>resp;
    }
}
Este sitio web fue creado de forma gratuita con PaginaWebGratis.es. ¿Quieres también tu sitio web propio?
Registrarse gratis