Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main(){
- int S = 0, optiunea, valoare_tranzactionata;
- do{
- printf("Alege o optiune:\n");
- printf("1. Interogare\n");
- printf("2. Extragere\n");
- printf("3. Depunere\n");
- printf("0. Exit\n");
- fflush(stdout);
- scanf("%d", &optiunea);
- switch(optiunea){
- case 1:
- printf("Suma din cont este: %d\n", S);
- fflush(stdout);
- //break;
- case 2:
- printf("Introduceti suma de extras: ");
- fflush(stdout);
- scanf("%d", &valoare_tranzactionata);
- S = S - valoare_tranzactionata;
- break;
- case 3:
- printf("Introduceti suma de depus: ");
- fflush(stdout);
- scanf("%d", &valoare_tranzactionata);
- S = S + valoare_tranzactionata;
- break;
- default:
- printf("Optiune inexistenta!\n");
- fflush(stdout);
- }
- } while(optiunea != 0);
- printf("Operatiuni incheiate!");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement