Skip to content

Commit 8969050

Browse files
authored
Merge pull request mouredev#7657 from Jean-Carlos-Backend-Developer/main
#00 - c#
2 parents 1c35fcb + 24aa315 commit 8969050

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
//------------------------------------------------------------------------------------
2+
/*
3+
1. Crea un comentario en el código y coloca la URL del sitio web oficial del
4+
lenguaje de programación que has seleccionado.
5+
*/
6+
7+
//Sitio oficial de C#: https://learn.microsoft.com/en-us/dotnet/csharp/
8+
9+
//------------------------------------------------------------------------------------
10+
/*
11+
2. Representa las diferentes sintaxis que existen de crear comentarios
12+
en el lenguaje(en una línea, varias...).
13+
*/
14+
15+
//Esto es un comentario de una línea
16+
17+
/*Esto es un comentario de
18+
varias líneas*/
19+
20+
//------------------------------------------------------------------------------------
21+
/*
22+
3. Crea una variable(y una constante si el lenguaje lo soporta).
23+
*/
24+
25+
int entero = 1;
26+
const int Max_Items = 15;
27+
28+
//------------------------------------------------------------------------------------
29+
30+
/*
31+
4. Crea variables representando todos los tipos de datos primitivos
32+
del lenguaje(cadenas de texto, enteros, booleanos...).
33+
*/
34+
35+
//Enteros
36+
byte byteVar = 255;
37+
sbyte sbyteVar = -128;
38+
short shortVar = 32767;
39+
ushort ushortVar = 65535;
40+
int intVar = 2147483647;
41+
uint uintVar = 4294967295;
42+
long longVar = 9223372036854775807L;
43+
ulong ulongVar = 18446744073709551615UL;
44+
45+
//Punto flotante
46+
float floatVar = 3.14f;
47+
double doubleVar = 3.14159265359;
48+
decimal decimalVar = 3.14159265359m;
49+
50+
// Booleano
51+
bool boolVar = true;
52+
53+
// Caracteres y cadenas
54+
char charVar = 'A';
55+
string stringVar = "Hola mundo";
56+
57+
// Fecha y hora
58+
DateTime dateTimeVar = DateTime.Now;
59+
60+
//------------------------------------------------------------------------------------
61+
/*
62+
5. Imprime por terminal el texto: "¡Hola, [y el nombre de tu lenguaje]!"
63+
*/
64+
65+
Console.WriteLine("¡Hola, C#!");
66+
67+
//------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)