jueves, 10 de octubre de 2013

PROGRAMA 21

/*Precio:
Descuento:
Descuento en %
Precio Final: */

#include<stdio.h>
main()
{
    float P,C,CD,PD,D,PT,T;
    char d; d='s';
    while (d=='s')
    {
        printf("Porciento del producto:");
        scanf ("%f",&P);
        printf("Porciento de descuento:");
        scanf("%f",&PD);
        D=PD/100;
        CD=P*D;
        PT=P-CD;
        T=T+PT;
        printf("Desea agregar otro producto:");
        d=getchar();
        scanf("%c",&d);
    }
    printf("El total es:%f",T);
    return 0;

}

No hay comentarios:

Publicar un comentario