#include<stdio.h>
#include<stdlib.h>


int main() 
{
 float d;
 int i;
 float iva;
 int n;
 char np[20];
 float st;
 float vcd;
 float vp;
 float vt;
 float vu;
 printf("Ingrese Numero de artículos \n");
 scanf("%i",&n);
 i = 0;
 while (i<n) 
 {
  printf("Ingrese nombre del producto\n");
  scanf("%s",np);
  printf("Ingrese valor o costo del producto\n");
  scanf("%f",&vu);
  if (vu>=200.00) 
  {
   d = vu*0.15;
  } else 
  {
   if (vu>100.00 && vu<200.00) 
   {
    d = vu*0.12;
   } else 
   {
    d = vu*0.10;
   }
  }
  vcd = vu-d;
  printf("El costo del producto es de: $%f\n",vu);
  printf("El valor del descuento es de: $%f\n",d);
  st = ((vu+iva)-d);
  vt = vt+st;
  i = i+1;
 }
 printf("el costo total de los productos es de: $%f\n",vt);
 return 0;

}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: