- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Implicit conversion from Byte to Decimal in C#
Byte represents an 8-bit unsigned integer.
Implicit conversion of an 8-bit unsigned integer (Byte) to a Decimal is possible. Let us see how.
Here’s our Byte value.
byte val = 16;
To implicitly convert, just assign the value as shown below −
decimal dec; dec = val;
Let us see the complete example.
Example
using System; public class Demo { public static void Main() { byte val = 16; decimal dec; // implicit dec = val; Console.WriteLine("Decimal ="+dec); } }
Output
Decimal =16
Advertisements