Sektion 2. Kapitel 9
single
Challenge: String Formatting
Stryg for at vise menuen
Opgave
Stryg for at begynde at kode
Your challenge is to practice declaring variables and formatting strings in C#.
- Declare a string variable named
nameand assignAlice. - Declare an integer variable named
ageand assign20. - Print a sentence that uses both variables, formatted like this:
Hello, my name is Alice and I am 20 years old. - Use string formatting to combine the variables and text in the output.
Løsning
Var alt klart?
Tak for dine kommentarer!
Sektion 2. Kapitel 9
single
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat