Skip to content

Instantly share code, notes, and snippets.

@MendesGabriel
Created May 1, 2017 18:56
Show Gist options
  • Save MendesGabriel/694febdbb888c37c4d259942693625e7 to your computer and use it in GitHub Desktop.
Save MendesGabriel/694febdbb888c37c4d259942693625e7 to your computer and use it in GitHub Desktop.
ex. caixa eletrônico em C (em andamento)
#ex de caixa eletronico
#include <stdio.h>
int main() {
int n2, n5, n10, n20, n50, n100, valor;
printf("Digite valor de saque:");
scanf("%d", &valor);
n100 = valor / 100;
valor = valor % 100;
n50 = valor / 50;
valor = valor % 50;
n20 = valor / 20;
valor = valor % 20;
n10 = valor / 10;
valor = valor % 10;
n5 = valor / 5;
valor = valor % 5;
n2 = valor / 2;
valor = valor % 2;
printf("100,00 = %d, 50,00 = %d, 20,00 = %d 10,00 = %d, 5,00 = %d, 2,00 = %d\n", n100, n50, n20, n10, n5, n2);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment