Skip to content

Instantly share code, notes, and snippets.

@GeriG34
Created February 10, 2025 03:33
Show Gist options
  • Save GeriG34/51636eb61b0a5dadf68e9433fe6becdf to your computer and use it in GitHub Desktop.
Save GeriG34/51636eb61b0a5dadf68e9433fe6becdf to your computer and use it in GitHub Desktop.
using System.Diagnostics.Metrics;
namespace ConsoleApp8
{
internal class Program
{
static void Main(string[] args)
{
Random rnd = new Random();
int value = rnd.Next();
int two = 2;
int degree = two;
int counter = 1;
while (degree <= value)
{
degree = degree * two;
counter++;
}
if (degree > value)
{
Console.WriteLine(value);
Console.WriteLine(counter);
Console.WriteLine(degree);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment