Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace zad_11
- {
- class zad_11
- {
- static void Main(string[] args)
- {
- Console.Write("Enter the value - n: ");
- long n = long.Parse(Console.ReadLine());
- Console.WriteLine();
- Console.Write("Enter the value - p: ");
- int p = int.Parse(Console.ReadLine());
- Console.WriteLine();
- long constanta = 1;
- long newNomber = n >> p;
- Console.WriteLine(
- (newNomber == 1) & (constanta == 1) ? "position of the selected value of the bit is: 1" :
- "position of the selected value of the bit is: 0");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement