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