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# Numeric Promotion
Numeric promotion as the name suggests is the promotion of smaller types to larger types like short to int.
In the below example, we have seen numeric promotion in Arithmetic Operator multiply.
The short types are automatically promoted to larger types −
Example
using System;
class Program {
static void Main() {
short val1 = 99;
ushort val2 = 11;
int res = val1 * val2;
Console.WriteLine(res);
}
} Advertisements
