Challenge: String Formatting
Task
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.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 2. ChapterΒ 9
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Suggested prompts:
Can you explain this in more detail?
What are the next steps I should take?
Can you give me an example?
Awesome!
Completion rate improved to 1.67
Challenge: String Formatting
Swipe to show menu
Task
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.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 2. ChapterΒ 9
single