Skip to content

Instantly share code, notes, and snippets.


parzibyte/calcular_descuento.c Secret

Created Nov 13, 2020
What would you like to do?
#include <stdio.h>
int main()
float precioOriginal, porcentajeDescuento;
printf("Ingresa el precio original: ");
scanf("%f", &precioOriginal);
printf("Ingresa el porcentaje de descuento: ");
scanf("%f", &porcentajeDescuento);
float descuento = precioOriginal * (porcentajeDescuento / 100);
float precioConDescuento = precioOriginal - descuento;
printf("Precio con descuento: %0.2f", precioConDescuento);
return 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.