Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Power
- {
- static void Main()
- {
- Console.Write("n = ");
- int n = Int32.Parse(Console.ReadLine());
- Console.Write("m = ");
- int m = Int32.Parse(Console.ReadLine());
- decimal result = 1;
- for(int i = 0; i < m; i++)
- {
- result *= n;
- }
- Console.WriteLine("n to the power of m is {0}", result);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment