Advertisement
martinvalchev

Integer_to_Hex_and_Binary

Jan 31st, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.40 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Integer_to_Hex_and_Binary
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int input = int.Parse(Console.ReadLine());
  10.  
  11.             string hex = Convert.ToString(input, 16).ToUpper();
  12.             Console.WriteLine(hex);
  13.             string binary = Convert.ToString(input, 2);
  14.             Console.WriteLine(binary);
  15.         }
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement