Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace MathPower
- {
- class Program
- {
- static void Main(string[] args)
- {
- double num = double.Parse(Console.ReadLine());
- int power = int.Parse(Console.ReadLine());
- RaiseToPower(num, power);
- }
- static double RaiseToPower(double num, int power)
- {
- double print = num;
- for (int i = 0; i < power - 1; i++)
- {
- print *= num;
- }
- Console.WriteLine(print);
- return (print);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement