pupesko

SoftUni - 3.3 Variable in Hexadecimal Format

Oct 26th, 2015
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  1. //Declare an integer variable and assign it with the value 254 in hexadecimal format (0x##). Use Windows Calculator to find its hexadecimal representation. Print the variable and ensure that the result is “254”.
  2.  
  3. using System;
  4.  
  5. namespace AssigningValues
  6. {
  7.     class AssigningValue
  8.     {
  9.         static void Main()
  10.         {
  11.             int numA = 0xFE;
  12.             Console.WriteLine(numA);
  13.         }
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment