Advertisement
Guest User

Untitled

a guest
Jan 12th, 2015
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.44 KB | None | 0 0
  1.  
  2. PrintLn("Welcome the the calulator");
  3.  
  4. PrintLn("Please enter number a :");
  5. let a = ReadLn();
  6.  
  7. let c = ReadLnP("Operator :");
  8.  
  9. let b = ReadLnP("Please enter number b :");
  10.  
  11. let awnser = 0;
  12. if c = "+"
  13. {
  14. awnser = Int(a) + Int(b)
  15. }
  16. if c = "-"
  17. {
  18. awnser = Int(a) - Int(b)
  19. }
  20. if c = "/"
  21. {
  22. awnser = Int(a) / Int(b)
  23. }
  24. if c = "*"
  25. {
  26. awnser = Int(a) * Int(b)
  27. }
  28.  
  29. let a1 = String(awnser);
  30.  
  31.  
  32. PrintLn("Awnser is %0", a1);
  33. Pause();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement