Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen Herausforderung: Zeichenfolgenformatierung | Umgang mit Datentypen
C# Grundlagen

bookHerausforderung: Zeichenfolgenformatierung

Korrigiere den Code, sodass die Werte korrekt in den String output eingebettet werden.

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 } }

Achte auf fehlende Symbol(e) in der String-Formatierungssyntax.

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 } }

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 2. Kapitel 9

Fragen Sie AI

expand

Fragen Sie AI

ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

Suggested prompts:

What is the current code that needs to be fixed?

Can you show me the part of the code where the string formatting is used?

What programming language is this code written in?

Awesome!

Completion rate improved to 1.59

bookHerausforderung: Zeichenfolgenformatierung

Swipe um das Menü anzuzeigen

Korrigiere den Code, sodass die Werte korrekt in den String output eingebettet werden.

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 } }

Achte auf fehlende Symbol(e) in der String-Formatierungssyntax.

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 } }

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 2. Kapitel 9
some-alt