Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. private void calc(int nm1, int nm2, string type)
  2. {
  3. int Output;
  4. switch (type)
  5. {
  6. case "+":
  7. Output = nm1 + nm2;
  8. break;
  9. case "-":
  10. Output = nm1 - nm2;
  11. break;
  12. case "*":
  13. Output = nm1 * nm2;
  14. break;
  15. case "/":
  16. Output = nm1 / nm2;
  17. break;
  18. case "2":
  19. int nm1output = nm1;
  20. int ggr;
  21. for (ggr = nm2; ggr > 0; ggr--)
  22. {
  23. nm1output = nm1output * nm1;
  24. }
  25. break;
  26.  
  27.  
  28. }
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement