Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Challenge: Variable Declaration | Getting Started
C# Basics

Challenge: Variable DeclarationChallenge: Variable Declaration

Complete the code by declaring the variables value_1 and value_2 having values 10 and 20 respectively.

cs

main.cs

1. Use the var keyword and the assignment operator (=) for variable declaration.

namespace ConsoleApp
{
    internal class Program
    {
        static void Main(string[] args)
        {
            // Write code below this line
            var value_1 = 10;
            var value_2 = 20;
            // Write code above this line


            System.Console.WriteLine("Value 1: " + value_1);
            System.Console.WriteLine("Value 2: " + value_2);
        }
    }
}
      

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

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

Зміст курсу

C# Basics

Challenge: Variable DeclarationChallenge: Variable Declaration

Complete the code by declaring the variables value_1 and value_2 having values 10 and 20 respectively.

cs

main.cs

1. Use the var keyword and the assignment operator (=) for variable declaration.

namespace ConsoleApp
{
    internal class Program
    {
        static void Main(string[] args)
        {
            // Write code below this line
            var value_1 = 10;
            var value_2 = 20;
            // Write code above this line


            System.Console.WriteLine("Value 1: " + value_1);
            System.Console.WriteLine("Value 2: " + value_2);
        }
    }
}
      

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

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