class BitPosition
{
static void Main() {
Console.Write("Input a number n:");
int number = int.Parse(Console.ReadLine());
Console.WriteLine("Input position p(0 the right bit):");
int p = int.Parse(Console.ReadLine());
int bit = (number >> p) & 1;
Console.WriteLine($"On posion {p} we have: {bit}");
}
}
Comments
0 B
|👍
/👎
0 B
|👍
/👎