Created
November 13, 2020 05:13
-
-
Save parzibyte/9d59aa7c2227683ff04d073c57637979 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
float precioConAumento, porcentajeAumento; | |
printf("Ingresa el porcentaje de aumento: "); | |
scanf("%f", &porcentajeAumento); | |
printf("Ingresa el valor con el porcentaje aplicado: "); | |
scanf("%f", &precioConAumento); | |
// Sumamos el porcentaje de descuento a cien | |
float porcentajeReal = 100 + porcentajeAumento; | |
// Y ahora sacamos el valor real. Para ello... | |
float precioOriginal = (100 * precioConAumento) / porcentajeReal; | |
printf("Valor original: %0.2f", precioOriginal); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment