Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Four_bit_binary_to_denary
- {
- class Program
- {
- public static void Main(string[] args)
- {
- int answer = 0;
- int column = 8;
- while (column >= 1) {
- Console.WriteLine("Enter bit value: ");
- int bit = Int32.Parse(Console.ReadLine());
- answer = answer + (column * bit);
- column = column/2;
- }
- Console.WriteLine("Decimal value is: {0}", answer);
- Console.ReadKey(true);
- }
- }
- }|
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement