Advertisement
Guest User

Modify Bit

a guest
May 24th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.62 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Modify_Bit
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             ushort number = ushort.Parse(Console.ReadLine());
  14.             //byte position = byte.Parse(Console.ReadLine());
  15.             //byte bitValue = byte.Parse(Console.ReadLine());
  16.             string byteNumber = Convert.ToString(number, 2);
  17.             for (int i = 0; i < byteNumber.Length; i++)
  18.             {
  19.                 Console.Write(byteNumber[i] + " ");
  20.             }
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement