Int16 : Este Int16 -32768 a +32767
C#
// C# program to show the // Int16 Struct usage 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
Int32 : Este Int32 -2147483648 a +2147483647
C#
// C# program to show the // Int32 struct usage using System; using System.Text; public class GFG { // Main Method static void Main(string[] args) { // printing minimum & maximum values Console.WriteLine("Minimum value of Int32: " + Int32.MinValue); Console.WriteLine("Maximum value of Int32: " + Int32.MaxValue); Console.WriteLine(); // Int32 array Int32[] arr1 = {-3, 0, 1, 3, 7}; foreach (Int32 i in arr1) { Console.WriteLine(i); } } }
Producción:
Minimum value of Int32: -2147483648 Maximum value of Int32: 2147483647 -3 0 1 3 7
Int64 : Este Int64 -9,223,372,036,854,775,808 a +9, 223,372,036,854,775,807
C#
// C# program to show // Int64 struct usage using System; using System.Text; public class GFG { // Main Method static void Main(string[] args) { // printing minimum & maximum values Console.WriteLine("Minimum value of Int64: " + Int64.MinValue); Console.WriteLine("Maximum value of Int64: " + Int64.MaxValue); Console.WriteLine(); // Int64 array Int64[] arr1 = {-3, 0, 1, 3, 7}; foreach (Int64 i in arr1) { Console.WriteLine(i); } } }
Producción:
Minimum value of Int64: -9223372036854775808 Maximum value of Int64: 9223372036854775807 -3 0 1 3 7
Diferencia entre Int16, Int32 e Int64 en C#
No Señor |
INT16 |
INT32 |
INT64 |
1. |
int16 | Int32 | Int64 64 |
2. |
int16 | Int32 también | Int64 también |
3. |
|||
4. |
|||
5. |
Tint16 | TInt32 | TInt64 |
6. |
Sintaxis para declarar el Int16 : Int16 variable_name; |
Sintaxis para declarar el Int32 : Int32 variable_name; |
Sintaxis para declarar el Int64 : Int64 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