-
-
Save parzibyte/d3c06ceb56098f27566d4202e0fe8094 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int retirarDinero(struct NodoDeCliente *nodo, char *numeroCuenta, double cantidad) | |
{ | |
while (nodo != NULL) | |
{ | |
if (strcmp(nodo->numeroCuenta, numeroCuenta) == 0) | |
{ | |
if (nodo->saldo >= cantidad) | |
{ | |
nodo->saldo = nodo->saldo - cantidad; | |
return 1; | |
} | |
else | |
{ | |
return 0; | |
} | |
} | |
nodo = nodo->siguiente; | |
} | |
return 0; | |
} | |
int depositarDinero(struct NodoDeCliente *nodo, char *numeroCuenta, double cantidad) | |
{ | |
return retirarDinero(nodo, numeroCuenta, -cantidad); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment