Challenge: String Formatting
Oppgave
Swipe to start coding
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 12
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
Fantastisk!
Completion rate forbedret til 1.25
Challenge: String Formatting
Sveip for å vise menyen
Oppgave
Swipe to start coding
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 12
single