Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- class XtoY
- {
- static void Main()
- {
- int result = Power(10, 6);
- Console.WriteLine(result);
- }
- static int Power(int x, int y)
- {
- if (y == 0)
- {
- return 1;
- }
- if (y == 1)
- {
- return x;
- }
- return x * Power(x, y - 1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement