Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created September 9, 2022 16:47
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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