Advertisement
Javinator9889

Expendedora

Sep 26th, 2018
387
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 KB | None | 0 0
  1. printf("Introduzca el importe: ");
  2.                 scanf("%f", &importe);
  3.                 a=importe-1.5;
  4.                 printf("\nEl cambio a devolver es: %.2f euros", a);
  5.                 parte_entera=a/1;
  6.                 parte_decimal=a-parte_entera;
  7.                 b=(parte_decimal/0.50);
  8.                 c=(parte_entera%2)/1;
  9.                 d=parte_entera/2;
  10.                 printf("\nSe devolver%cn %.0f moneda(s) de 50 centimos, %d moneda(s) de 1 euro y %d moneda(s) de 2 euros \n",160, b, c, d);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement