Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. #include<stdio.h>
  2. int main(){
  3. int S = 0, optiunea, valoare_tranzactionata;
  4.  
  5.  
  6. do{
  7. printf("Alege o optiune:\n");
  8. printf("1. Interogare\n");
  9. printf("2. Extragere\n");
  10. printf("3. Depunere\n");
  11. printf("0. Exit\n");
  12. fflush(stdout);
  13. scanf("%d", &optiunea);
  14. switch(optiunea){
  15. case 1:
  16. printf("Suma din cont este: %d\n", S);
  17. fflush(stdout);
  18. //break;
  19. case 2:
  20. printf("Introduceti suma de extras: ");
  21. fflush(stdout);
  22. scanf("%d", &valoare_tranzactionata);
  23. S = S - valoare_tranzactionata;
  24. break;
  25. case 3:
  26. printf("Introduceti suma de depus: ");
  27. fflush(stdout);
  28. scanf("%d", &valoare_tranzactionata);
  29. S = S + valoare_tranzactionata;
  30. break;
  31. default:
  32. printf("Optiune inexistenta!\n");
  33. fflush(stdout);
  34. }
  35.  
  36. } while(optiunea != 0);
  37. printf("Operatiuni incheiate!");
  38. return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement