12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp1
- {
- public class Calculate
- {
- public static double Sum(double x,double y)
- {
- return x + y;
- }
- public static double Subtraction(double x, double y)
- {
- return x - y;
- }
- public static double Multiplication(double x, double y)
- {
- return x * y;
- }
- public static double Division(double x, double y)
- {
- return x / y;
- }
- public static double Exponentiation(double x, double y)
- {
- if(y != 0)
- {
- double result = x;
- for (int i = 1; i < y; i++)
- {
- result = result * x;
- }
- return result;
- }
- else
- {
- return 1;
- }
- }
- }
- }
|