Ingeniero

Páginas: 2 (281 palabras) Publicado: 26 de noviembre de 2012
TIPOS DE DATOS
Tipo C# | Nombre para la plataforma .NET | Con signo? | Bytes utilizados | Valores que soporta |
bool | System.Boolean | No | 1 | true o false (verdadero o falso en inglés) |byte | System.Byte | No | 1 | 0 hasta 255 |
sbyte | System.SByte | Si | 1 | -128 hasta 127 |
short | System.Int16 | Si | 2 | -32.768 hasta 32.767 |
ushort | System.Uint16 | No | 2 | 0 hasta 65535 |int | System.Int32 | Si | 4 | -2.147.483.648 hasta 2.147.483.647 |
uint | System.Uint32 | No | 4 | 0 hasta 4.394.967.395 |
long | System.Int64 | Si | 8 | -9.223.372.036.854.775.808 hasta9.223.372.036.854.775.807 |
ulong | System.Uint64 | No | 8 | 0 hasta 18446744073709551615 |
float | System.Single | Si | 4 | Approximadamente ±1.5E-45 hasta ±3.4E38 con 7 cifras significativas |double | System.Double | Si | 8 | Approximadamente ±5.0E-324 hasta ±1.7E308 con 7 cifras significativas |
decimal | System.Decimal | Si | 12 | Approximadamente ±1.0E-28 hasta ±7.9E28 con 28 ó 29 cifrassignificativas |
char | System.Char | | 2 | Cualquier carácter Unicode (16 bits) |

EJEMPLOS
ENTEROS
public static void Main()
{
int minuto = 60; //segundos por minuto
inthora = minuto*60;
int dia = hora*24;
long anio = dia*365;
Console.WriteLine("Segundos en un dia:"+ dia);
Console.WriteLine("Segundos en un año: "+ anio);
}FLOTANTES
-------------------------------------------------
int a = 2;
-------------------------------------------------
double log2 = Math.Log(a);-------------------------------------------------
double raiz2 = Math.Sqrt(a);
-------------------------------------------------
Console.WriteLine("Ellogaritmo de dos es ", log2 );
-------------------------------------------------
Console.WriteLine("La raiz de dos es ", raiz2 );

La siguiente lista contiene los caracteres...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Ingeniero
  • Ingeniero
  • Ingeniero
  • Ingeniero
  • Ingeniero
  • Ingeniero
  • Ingeniero
  • Ingeniero

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS