Int To Hex - CSharp System

CSharp examples for System:Hex

Description

Int To Hex

Demo Code

//     Copyright (c) Microsoft Corporation.  All rights reserved.
using System.Text;
using System;// w  w w  . j  ava  2  s  .  c  om

public class Main{
        public static char IntToHex( int n ) {
			if( n <= 9 )
				return (char)( n + (int)'0' );
			else
				return (char)( n - 10 + (int)'a' );
		}
}

Related Tutorials