Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele Haaste: Muuttujan Määrittely | Aloitus
Quizzes & Challenges
Quizzes
Challenges
/
C# Perusteet

bookHaaste: Muuttujan Määrittely

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

main.cs

main.cs

copy
12345678910111213141516
namespace ConsoleApp { internal class Program { static void Main(string[] args) { // Write code below this line // Write code above this line System.Console.WriteLine("Value 1: " + value_1); System.Console.WriteLine("Value 2: " + value_2); } } }
  1. Use the var keyword and the assignment operator (=) for variable declaration.
main.cs

main.cs

copy
1234567891011121314151617
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); } } }

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 1. Luku 9

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

Suggested prompts:

What is the correct way to declare variables using the `var` keyword?

Can you show an example of how to assign values to variables in JavaScript?

Do you have any tips for remembering variable declaration syntax?

bookHaaste: Muuttujan Määrittely

Pyyhkäise näyttääksesi valikon

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

main.cs

main.cs

copy
12345678910111213141516
namespace ConsoleApp { internal class Program { static void Main(string[] args) { // Write code below this line // Write code above this line System.Console.WriteLine("Value 1: " + value_1); System.Console.WriteLine("Value 2: " + value_2); } } }
  1. Use the var keyword and the assignment operator (=) for variable declaration.
main.cs

main.cs

copy
1234567891011121314151617
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); } } }

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 1. Luku 9
some-alt