Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.39 KB | None | 0 0
  1. static void conversion(string value)
  2. {
  3.     Console.WriteLine("{0} to decimal is {1}.",
  4.         value, Convert.ToInt32(value, 16));
  5.     Console.WriteLine("{0} to decimal is {1}.\n", value,
  6.         Convert.ToString(Convert.ToInt32(value, 16), 2));    
  7. }
  8.  
  9. static void Main(string[] args)
  10. {
  11.     conversion("2A3E");
  12.     conversion("FA");
  13.     conversion("FFFF");
  14.     conversion("5A0E9");
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement