Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program
- {
- static void Main(string[] args)
- {
- Random random = new Random();
- int minValue = 0;
- int maxValue = 1000;
- int givenNumber = random.Next(minValue, maxValue);
- int numberRaisedToPower = 2;
- int power = 2;
- int numberInPower = 2;
- int numberOfPower = 1;
- while (numberInPower < givenNumber)
- {
- numberInPower *= power;
- numberOfPower++;
- }
- Console.WriteLine($"Число - {givenNumber}\n" +
- $"Степень - {numberOfPower}\n" +
- $"Число {numberRaisedToPower} в заданой степени - {numberInPower}");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement