Venciity

[ Telerik C#] Primitives And Variables - EX 4

Feb 13th, 2014
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  1. // 4. Declare an integer variable and assign it with the value 254 in hexadecimal format.
  2. // Use Windows Calculator to find its hexadecimal representation.
  3.  
  4. using System;
  5.  
  6. namespace _04_HexVariable
  7. {
  8.     class HexVariable
  9.     {
  10.         static void Main()
  11.         {
  12.             int numberInHex = 0xFE;
  13.             Console.WriteLine("This is an int variable with hex value: {0}",numberInHex);
  14.         }
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment