
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Convert Byte Value to Int32 Value in C#
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