Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
C# Program to convert a Byte value to an Int32 value
To convert a Byte value to an Int32 value, use the Convert.ToInt32() method.
Int32 represents a 32-bit signed integer.
Let’s say the following is our Byte value.
byte val = Byte.MaxValue;;
Now to convert it to Int32.
int intVal = Convert.ToInt32(val);
Let us see the complete example.
Example
using System;
public class Demo {
public static void Main() {
byte val = Byte.MaxValue;;
int intVal = Convert.ToInt32(val);
Console.WriteLine("Converted byte {0} to Int32 {1} value ", val, intVal);
}
}
Output
Converted byte 255 to Int32 255 value
Advertisements
