Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class DecimalToBinary
- {
- static void Main()
- {
- long number = long.Parse(Console.ReadLine());
- string binary = "";
- do
- {
- binary = Convert.ToString(number % 2) + binary;
- number /= 2;
- } while (number > 0);
- Console.WriteLine(binary);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement