Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class CheckThirdBit
- {
- static void Main()
- {
- Console.Write("Enter your number: ");
- int a = int.Parse(Console.ReadLine());
- int b = 8;
- if ((a & b) == 8)
- {
- Console.WriteLine("The third bit of number {0} is 1.", a);
- }
- else
- {
- Console.WriteLine("The third bit of number {0} is 0.", a);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement