1
1
using System ;
2
2
using System . Collections . Generic ;
3
3
using System . Linq ;
4
+ using System . Runtime . CompilerServices ;
5
+ using System . Runtime . ConstrainedExecution ;
6
+ using System . Security . Policy ;
7
+ using System . Text ;
8
+ using System . Threading . Tasks ;
4
9
using System . Text ;
5
10
using System . Threading . Tasks ;
6
11
@@ -74,3 +79,62 @@ public void Saludo()
74
79
}
75
80
}
76
81
82
+ namespace _00_SINTAXIS__VARIABLES__TIPOS_DE_DATOS_Y_HOLA_MUNDO
83
+ {
84
+ internal class Program
85
+ {
86
+ static void Main ( string [ ] args )
87
+ {
88
+ // EJERCICIO:
89
+ //1-Crea un comentario en el código y coloca la URL del sitio web oficial del
90
+ // lenguaje de programación que has seleccionado.
91
+ //https://learn.microsoft.com/en-us/dotnet/csharp/
92
+
93
+ //2-Representa las diferentes sintaxis que existen de crear comentarios
94
+ // en el lenguaje(en una línea, varias...).
95
+
96
+ // Esta reprenta un comentario de una linea
97
+ /*
98
+ * esta representa un comentarios de varias lineas
99
+ */
100
+
101
+ //3-Crea una variable(y una constante si el lenguaje lo soporta).
102
+
103
+ //4-Crea variables representando todos los tipos de datos primitivos
104
+ // del lenguaje(cadenas de texto, enteros, booleanos...).
105
+
106
+ //5-Imprime por terminal el texto: "¡Hola, [y el nombre de tu lenguaje]!"
107
+ EJERCICIOS ejercicios = new EJERCICIOS ( ) ;
108
+ ejercicios . getLenguaje ( ) ;
109
+
110
+ }
111
+ public class EJERCICIOS
112
+ {
113
+ //3-Crea una variable(y una constante si el lenguaje lo soporta).
114
+ private int myNum ;
115
+ private const int numConst = 0 ;
116
+
117
+ //4-Crea variables representando todos los tipos de datos primitivos
118
+ // del lenguaje(cadenas de texto, enteros, booleanos...).
119
+ private int num1 ; //Números enteros de 32 bits.
120
+ private long num2 ; //Números enteros de 64 bits.
121
+ private short num3 ; //Números enteros de 16 bits.
122
+ private byte num4 ; //Números enteros sin signo de 8 bits.
123
+ private sbyte num5 ; //Números enteros con signo de 8 bits.
124
+ private uint num6 ; //Números enteros sin signo de 32 bits.
125
+ private ulong num7 ; //Números enteros sin signo de 64 bits.
126
+ private ushort num8 ; //Números enteros sin signo de 16 bits.
127
+ private float myfloat ; //Números de punto flotante de precisión simple(32 bits).
128
+ private double num_double ; //Números de punto flotante de doble precisión(64 bits).
129
+ private decimal num_decimal ; //Números decimales de alta precisión, generalmente usados para cálculos financieros(128 bits).
130
+ private bool boolean ; //Representa valores booleanos(true o false).
131
+ private char char1 ; //Representa un carácter Unicode UTF-16 (16 bits).
132
+ private string name ; //Secuencia de caracteres Unicode.
133
+
134
+ public void getLenguaje ( )
135
+ {
136
+ Console . WriteLine ( "¡Hola, [C#]!" ) ;
137
+ }
138
+ }
139
+ }
140
+ }
0 commit comments