Seksjon 2. Kapittel 9
single
Challenge: String Formatting
Sveip for å vise menyen
Oppgave
Sveip for å begynne å 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
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 2. Kapittel 9
single
Spør AI
Spør AI
Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår