Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- namespace ConsoleTest
- {
- class ConsoleTest
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- byte p = byte.Parse(Console.ReadLine());
- int shifted = n>>p;
- string num = Convert.ToString(shifted, 2);
- char bitAtPosition = num.Last();
- Console.WriteLine(bitAtPosition);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment