Marcos_Carvalho

cedulas

Mar 28th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3.  
  4. int main () {
  5.  
  6. int num, cedulas[6];
  7.  
  8. printf(" num: ");
  9. scanf("%d", &num);
  10.  
  11.  
  12. while (num >= 100){
  13. num= num-100 ;
  14. cedulas[1]++;
  15.  
  16. }
  17. printf(" %d notas de cem",cedulas[1]);
  18. cedulas[2]= 0;
  19. while (num >= 50){
  20. num= num-50 ;
  21. cedulas[2]++;
  22.  
  23. } printf("\n %d notas de cinquenta",cedulas[2]);
  24.  
  25.  
  26. cedulas[3]= 0;
  27. while (num >= 20){
  28. num= num-20 ;
  29. cedulas[3]++;
  30.  
  31. } printf(" \n %d notas de 20",cedulas[3]);
  32.  
  33. cedulas[4]= 0;
  34. while (num >= 10){
  35. num= num-10 ;
  36. cedulas[4]++;
  37.  
  38. } printf(" \n %d notas de 10",cedulas[4]);
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45. return 0;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment