Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
String Formatting Practice | Dealing with Data Types
course content

Зміст курсу

C# Basics

String Formatting PracticeString Formatting Practice

Fix the code so that the values are correctly embedded in the output string.

cs

main.cs

1. Look for any missing symbol(s) in the string formatting syntax.

using System;

internal class Program
{
    static void Main(string[] args)
    {

        int num_1 = 10;
        int num_2 = num_1 * 2;
        int num_3 = num_2 * 3;
        int num_4 = num_1 + num_2 + num_3;

        // Change code below this line
        Console.WriteLine($"The sum of {num_1}, {num_2} and {num_3} is {num_4}");
        // Change code above this line
    }
}
      

Все було зрозуміло?

Секція 2. Розділ 9
course content

Зміст курсу

C# Basics

String Formatting PracticeString Formatting Practice

Fix the code so that the values are correctly embedded in the output string.

cs

main.cs

1. Look for any missing symbol(s) in the string formatting syntax.

using System;

internal class Program
{
    static void Main(string[] args)
    {

        int num_1 = 10;
        int num_2 = num_1 * 2;
        int num_3 = num_2 * 3;
        int num_4 = num_1 + num_2 + num_3;

        // Change code below this line
        Console.WriteLine($"The sum of {num_1}, {num_2} and {num_3} is {num_4}");
        // Change code above this line
    }
}
      

Все було зрозуміло?

Секція 2. Розділ 9
some-alt