kirililchev3

Int to Hex (16) and Binary (2)

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