Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //IFF - Introdução à Programação
- //Slide - Página 33 - Exercício 4
- #include<stdio.h>
- #include<locale.h>
- int main(){
- setlocale(LC_ALL,"Portuguese");
- float saldo, valor;
- int resp;
- printf("Sistema básico financeiro.\n");
- do{
- printf("1 - Depósito \n2 - Retirada \n3 - Saldo \n4 - Sair\nOpção: ");
- scanf("%d",&resp);
- switch (resp){
- case 1:
- printf("\nEntre com o valor a ser depositado: R$");
- scanf("%f",&valor);
- saldo+=valor;
- break;
- case 2:
- printf("\nEntre com o valor a ser sacado: R$");
- scanf("%f",&valor);
- saldo-=valor;
- break;
- case 3:
- printf("\nSeu saldo é de R$%.2f",saldo);
- break;
- }
- printf("\n");
- }while(resp != 4);
- }
Advertisement
Add Comment
Please, Sign In to add comment