-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmonedas.c
More file actions
35 lines (25 loc) · 751 Bytes
/
Copy pathmonedas.c
File metadata and controls
35 lines (25 loc) · 751 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <stdio.h>
int main() {
int dinero;
int m10, m5, m2, m1;
int sobrante;
printf("Ingresa la cantidad a retirar: $");
scanf("%d", &dinero);
// --- AQUÍ VA TU LÓGICA ---
// Pista para empezar:
m10 = dinero / 10;
sobrante = dinero % 10;
// Ahora te toca a ti calcular m5, m2 y m1 usando el "sobrante"...
m5 = sobrante / 5;
sobrante = sobrante % 5;
m2 = sobrante / 2;
sobrante = sobrante % 2;
m1 = sobrante / 1;
// --- SALIDA DE DATOS ---
printf("\nDesglose de monedas:\n");
printf("Monedas de $10: %d\n", m10);
printf("Monedas de $5: %d\n", m5);
printf("Monedas de $2: %d\n", m2);
printf("Monedas de $1: %d\n", m1);
return 0;
}