C# Convert ToUInt16(Boolean)
Description
Convert ToUInt16(Boolean)
converts the specified Boolean
value to the equivalent 16-bit unsigned integer.
Syntax
Convert.ToUInt16(Boolean)
has the following syntax.
[CLSCompliantAttribute(false)]
public static ushort ToUInt16(
bool value
)
Parameters
Convert.ToUInt16(Boolean)
has the following parameters.
value
- The Boolean value to convert.
Returns
Convert.ToUInt16(Boolean)
method returns The number 1 if value is true; otherwise, 0.
Example
//from w w w . ja v a 2 s .c o m
using System;
public class MainClass{
public static void Main(String[] argv){
System.Console.WriteLine(Convert.ToUInt16(true));
}
}
The code above generates the following result.