Advertisement
shegues

enterDate.c

Jan 30th, 2021
673
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.59 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5.     int dollars;
  6.     int twenty, ten , five , one;
  7.     printf("Dammi i dollari: $ ");
  8.     scanf("%d", &dollars);
  9.     twenty = dollars / 20;
  10.     ten = (dollars - (twenty * 20)) / 10;
  11.     five = (dollars - ((twenty * 20) + (ten * 10))) / 5;
  12.     one = (dollars - (((twenty * 20) + (ten * 10)) + (five * 5)))  / 1;
  13.     printf("numbers of 20$ is : %d\n", twenty);
  14.     printf("numbers of 10$ is :%d\n", ten);
  15.     printf("numbers of 5$ is : %d\n", five);
  16.     printf("numbers of 1$ is : %d\n", one);
  17.     //printf("numbers of 1$ is : %d\n",
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement