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 12
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Awesome!
Completion rate improved to 1.25
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 12
single