Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp1
- {
- class Program
- {
- static int powah(int x, int y)
- {
- int result = 1;
- for (int i=0; i<y; i++)
- {
- result *= x;
- }
- return result;
- }
- static void Main(string[] args)
- {
- Console.WriteLine("Dwse arithmo kai dynamh");
- int arithmos = int.Parse(Console.ReadLine());
- int dynamh = int.Parse(Console.ReadLine());
- Console.WriteLine("To apotelesma einai: " + powah(arithmos, dynamh));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment