Int16 : Este Int16 -32768 a +32767
C#
// C# program to show the // difference between Int16 // and UInt16 using System; using System.Text; public class GFG { // Main Method static void Main(string[] args) { // printing minimum & maximum values Console.WriteLine("Minimum value of Int16: " + Int16.MinValue); Console.WriteLine("Maximum value of Int16: " + Int16.MaxValue); Console.WriteLine(); // Int16 array Int16[] arr1 = {-3, 0, 1, 3, 7}; foreach (Int16 i in arr1) { Console.WriteLine(i); } } }
Producción:
Minimum value of Int16: -32768 Maximum value of Int16: 32767 -3 0 1 3 7
UInt16 : este Int16 a 65535
C#
// C# program to show the // difference between Int16 // and UInt16 using System; using System.Text; public class GFG{ // Main Method static void Main(string[] args) { // printing minimum & maximum values Console.WriteLine("Minimum value of UInt16: " + UInt16.MinValue); Console.WriteLine("Maximum value of UInt16: " + UInt16.MaxValue); Console.WriteLine(); // Int16 array UInt16[] arr1 = { 13, 0, 1, 3, 7}; foreach (UInt16 i in arr1) { Console.WriteLine(i); } } }
Producción:
Minimum value of UInt16: 0 Maximum value of UInt16: 65535 13 0 1 3 7
Diferencias entre Int16 y UInt16 en C#
No Señor |
INT16 |
UINT16 |
1. |
int16 | UInt16 |
2. |
int16 | UInt16 |
3. |
||
4. |
||
5. |
Tint16 | El UInt16 va desde |
6. |
Sintaxis para declarar el Int16 : Int16 variable_name; |
Sintaxis para declarar el UInt16: UInt16 variable_name; |
Publicación traducida automáticamente
Artículo escrito por SHUBHAMSINGH10 y traducido por Barcelona Geeks. The original can be accessed here. Licence: CCBY-SA