Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- void main(){
- float consumo;
- printf("Introduzca el consumo mensual en minutos: ");
- scanf("%f", &consumo);
- if (0 <= consumo && consumo <= 180){
- printf("\nEl importe a pagar es %.2f (0.8 euros/min)\n", (consumo * 0.8));
- }
- else if (181 <= consumo && consumo <= 360){
- printf("\nEl importe a pagar es %.2f (0.6 euros/min)\n", (consumo * 0.6));
- }
- else if (consumo > 360){
- printf("\nEl importe a pagar es %.2f (0.4 euros/min)\n", (consumo * 0.4));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement