Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: String Formatting | Section
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
C# Basics
Sectionย 1. Chapterย 19
single

single

bookChallenge: 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 name and assign Alice.
  • Declare an integer variable named age and assign 20.
  • 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

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Sectionย 1. Chapterย 19
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

some-alt