Advertisement
AnitaN

02.PrimitiveDataTypesVariables/04.VariableHexadecimalFormat

Mar 9th, 2014
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.48 KB | None | 0 0
  1. //Problem 4. Variable in Hexadecimal Format
  2. //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”.
  3.  
  4. using System;
  5.  
  6. class VariableHexadecimalFormat
  7. {
  8.     static void Main()
  9.     {
  10.         //Assign integer variable with 254 in hexadecimal format(0x##)
  11.         int hexValue = 0xFE;
  12.         Console.WriteLine(hexValue);
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement