martes, 27 de agosto de 2019

Programa 8

Capturar el precio de 5 articulos, calcular la compra total, el IVA y el total a pagar. La salida debe ser La compra total es... El iva es... El total a pagar es...
#include <iostream>
#include <stdio.h>

using namespace std;
float arti,ct,iva,tp;
int i;

int main()
{
    for(i=1;i<=5;i++)
    {
        cout <<"INGRESA EL ARTICULO"<<endl;
        cin>>arti;
        ct=ct+arti;
    }
    cout <<"LA COMPRA TOTAL ES "<<ct<<endl;
    iva=ct*0.016;
    cout <<"EL IVA TOTAL ES "<<iva<<endl;
    tp=ct+iva;
    cout <<"EL TOTAL A PAGAR ES "<<tp<<endl;

    return 0;
}

No hay comentarios.:

Publicar un comentario