Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void calc(int nm1, int nm2, string type)
- {
- int Output;
- switch (type)
- {
- case "+":
- Output = nm1 + nm2;
- break;
- case "-":
- Output = nm1 - nm2;
- break;
- case "*":
- Output = nm1 * nm2;
- break;
- case "/":
- Output = nm1 / nm2;
- break;
- case "2":
- int nm1output = nm1;
- int ggr;
- for (ggr = nm2; ggr > 0; ggr--)
- {
- nm1output = nm1output * nm1;
- }
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement