Défi : Formatage de Chaîne
Corrigez le code afin que les valeurs soient correctement intégrées dans la chaîne output
.
main.cs
12345678910111213141516using 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 } }
Recherchez tout symbole manquant dans la syntaxe de formatage de chaîne.
main.cs
1234567891011121314151617using 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 } }
Merci pour vos commentaires !
Demandez à l'IA
Demandez à l'IA
Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion
What is the original code that needs fixing?
Can you show me where the values are supposed to be embedded in the output string?
Which programming language is this code written in?
Awesome!
Completion rate improved to 1.59
Défi : Formatage de Chaîne
Glissez pour afficher le menu
Corrigez le code afin que les valeurs soient correctement intégrées dans la chaîne output
.
main.cs
12345678910111213141516using 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 } }
Recherchez tout symbole manquant dans la syntaxe de formatage de chaîne.
main.cs
1234567891011121314151617using 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 } }
Merci pour vos commentaires !