Advertisement
Guest User

Untitled

a guest
Sep 26th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.54 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3. void main(){
  4.     float consumo;
  5.     printf("Introduzca el consumo mensual en minutos: ");
  6.     scanf("%f", &consumo);
  7.     if (0 <= consumo && consumo <= 180){
  8.         printf("\nEl importe a pagar es %.2f (0.8 euros/min)\n", (consumo * 0.8));
  9.     }
  10.     else if (181 <= consumo && consumo <= 360){
  11.         printf("\nEl importe a pagar es %.2f (0.6 euros/min)\n", (consumo * 0.6));
  12.     }
  13.     else if (consumo > 360){
  14.         printf("\nEl importe a pagar es %.2f (0.4 euros/min)\n", (consumo * 0.4));
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement