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
Implicit conversion from 16-bit unsigned integer (ushort) to Decimal in C#
UShort represents a 16-bit unsigned integer.
To implicitly convert of a 16-bit unsigned integer to a decimal, firstly set a ushort value.
ushort val = 193;
To convert ushort to decimal, assign the value.
decimal dec; dec = val;
Let us see an example.
Example
using System;
public class Demo {
public static void Main() {
ushort val = 2567;
decimal dec;
Console.WriteLine("Implicit conversion from 16-bit unsigned integer to Decimal");
dec = val;
Console.WriteLine("Decimal = "+dec);
}
} Advertisements
