Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Desafío: Comentarios | Primeros Pasos
Fundamentos de C#

bookDesafío: Comentarios

The following program prints numbers from 1 to 10. Comment out the lines that print odd numbers.

Note

Use single-line comments to solve this task.

main.cs

main.cs

copy
12345678910111213141516171819
namespace TestConsoleApp { internal class Program { static void Main(string[] args) { System.Console.WriteLine(1); System.Console.WriteLine(2); System.Console.WriteLine(3); System.Console.WriteLine(4); System.Console.WriteLine(5); System.Console.WriteLine(6); System.Console.WriteLine(7); System.Console.WriteLine(8); System.Console.WriteLine(9); System.Console.WriteLine(10); } } }
  1. Single-Line comments can be added using double-slash (//).
  2. Even numbers are those which can be divided into two equal parts or in other words those numbers which are divisible by 2. For-example: 2, 4, 6 etc. Odd numbers are the opposite of even numbers for-example: 1, 3, 5 etc.
main.cs

main.cs

copy
12345678910111213141516171819
namespace TestConsoleApp { internal class Program { static void Main(string[] args) { // System.Console.WriteLine(1); System.Console.WriteLine(2); // System.Console.WriteLine(3); System.Console.WriteLine(4); // System.Console.WriteLine(5); System.Console.WriteLine(6); // System.Console.WriteLine(7); System.Console.WriteLine(8); // System.Console.WriteLine(9); System.Console.WriteLine(10); } } }
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 1. Capítulo 6

Pregunte a AI

expand

Pregunte a AI

ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

Suggested prompts:

Can you show me the code that needs to be modified?

Can you explain how to identify odd numbers in the code?

Do you want an explanation of how single-line comments work in this context?

bookDesafío: Comentarios

Desliza para mostrar el menú

The following program prints numbers from 1 to 10. Comment out the lines that print odd numbers.

Note

Use single-line comments to solve this task.

main.cs

main.cs

copy
12345678910111213141516171819
namespace TestConsoleApp { internal class Program { static void Main(string[] args) { System.Console.WriteLine(1); System.Console.WriteLine(2); System.Console.WriteLine(3); System.Console.WriteLine(4); System.Console.WriteLine(5); System.Console.WriteLine(6); System.Console.WriteLine(7); System.Console.WriteLine(8); System.Console.WriteLine(9); System.Console.WriteLine(10); } } }
  1. Single-Line comments can be added using double-slash (//).
  2. Even numbers are those which can be divided into two equal parts or in other words those numbers which are divisible by 2. For-example: 2, 4, 6 etc. Odd numbers are the opposite of even numbers for-example: 1, 3, 5 etc.
main.cs

main.cs

copy
12345678910111213141516171819
namespace TestConsoleApp { internal class Program { static void Main(string[] args) { // System.Console.WriteLine(1); System.Console.WriteLine(2); // System.Console.WriteLine(3); System.Console.WriteLine(4); // System.Console.WriteLine(5); System.Console.WriteLine(6); // System.Console.WriteLine(7); System.Console.WriteLine(8); // System.Console.WriteLine(9); System.Console.WriteLine(10); } } }
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 1. Capítulo 6
some-alt