Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Desafio: Formatação de Strings | Lidando com Tipos de Dados
Fundamentos de C#

bookDesafio: Formatação de Strings

Corrija o código para que os valores sejam corretamente inseridos na string output.

main.cs

main.cs

copy
12345678910111213141516
using System; internal class Program { static void Main(string[] args) { int num_1 = 10; int num_2 = num_1 * 2; int num_3 = num_2 * 3; int num_4 = num_1 + num_2 + num_3; // Change code below this line Console.WriteLine("The sum of {num_1}, {num_2} and {num_3} is {num_4}"); // Change code above this line } }

Procure por qualquer símbolo ausente na sintaxe de formatação de strings.

main.cs

main.cs

copy
1234567891011121314151617
using System; internal class Program { static void Main(string[] args) { int num_1 = 10; int num_2 = num_1 * 2; int num_3 = num_2 * 3; int num_4 = num_1 + num_2 + num_3; // Change code below this line Console.WriteLine($"The sum of {num_1}, {num_2} and {num_3} is {num_4}"); // Change code above this line } }

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 2. Capítulo 9

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

Suggested prompts:

What is the current code that needs to be fixed?

Can you show me an example of the output string you want?

Which programming language is this code written in?

Awesome!

Completion rate improved to 1.56

bookDesafio: Formatação de Strings

Deslize para mostrar o menu

Corrija o código para que os valores sejam corretamente inseridos na string output.

main.cs

main.cs

copy
12345678910111213141516
using System; internal class Program { static void Main(string[] args) { int num_1 = 10; int num_2 = num_1 * 2; int num_3 = num_2 * 3; int num_4 = num_1 + num_2 + num_3; // Change code below this line Console.WriteLine("The sum of {num_1}, {num_2} and {num_3} is {num_4}"); // Change code above this line } }

Procure por qualquer símbolo ausente na sintaxe de formatação de strings.

main.cs

main.cs

copy
1234567891011121314151617
using System; internal class Program { static void Main(string[] args) { int num_1 = 10; int num_2 = num_1 * 2; int num_3 = num_2 * 3; int num_4 = num_1 + num_2 + num_3; // Change code below this line Console.WriteLine($"The sum of {num_1}, {num_2} and {num_3} is {num_4}"); // Change code above this line } }

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 2. Capítulo 9
some-alt