Advertisement
Mk83

Untitled

Nov 19th, 2019
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. program calculatrice;
  2.  
  3. var
  4. choice : byte;
  5. nombre1 : integer;
  6. nombre2 : integer;
  7. result : double;
  8. choice2 : byte;
  9. begin
  10. repeat
  11. Writeln('bienvenu dans la calculatrice');
  12. writeln('choisit ton option');
  13. writeln('1|addition');
  14. writeln('2|soustraction');
  15. writeln('3|multiplication');
  16. writeln('4|division');
  17. writeln('5|quitter');
  18. readln (choice);
  19. if choice = 5 then
  20. begin
  21. writeln('au revoir');
  22. exit
  23. end;
  24. if choice > 5 then
  25. begin
  26. writeln('arrete de te foutre de moi c n est pas dans le choix');
  27. Writeln('choisit un premier nombre');
  28. readln (nombre1);
  29. writeln('chopisit un deuxieme nombre');
  30. readln(nombre2);
  31. end;
  32.  
  33. if choice = 1 then
  34. begin
  35. result := nombre1 + nombre2;
  36. Writeln('ton resultat est egale a',result:6:2);
  37. end;
  38. if choice = 2 then
  39. begin
  40. result := nombre1 - nombre2;
  41. Writeln('ton resultat est egale a',result:6:2);
  42. end;
  43. if choice = 3 then
  44. begin
  45. result := nombre1 * nombre2;
  46. Writeln('ton resultat est egale a',result:6:2);
  47. end;
  48. if choice = 4 then
  49. begin
  50. result := nombre1 / nombre2;
  51. Writeln('ton resultat est egale a',result:6:2);
  52. end;
  53.  
  54. writeln('veut tu recommencer ecrit 1|2 pour oui|non');
  55. readln(choice2);
  56.  
  57. writeln('choix: ', choice2);
  58.  
  59. until choice2 = 2 ;
  60. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement