This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Задача 25: Напишите цикл, который принимает на вход два числа (A и B) и возводит число A в натуральную степень B. | |
// 3, 5 -> 243 (3⁵) | |
// 2, 4 -> 16 | |
Console.WriteLine($"\nЗадача 25. Возведене числа A в натуральную степень B"); | |
int Exponentiation(int numberA, int numberB){ | |
int result = 1; | |
for(int i=1; i <= numberB; i++){ | |
result = result * numberA; | |
} |