Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lära Utmaning: Variabeldeklaration | Komma Igång
C#-Grunder

bookUtmaning: Variabeldeklaration

Fyll i koden genom att deklarera variablerna value_1 och value_2 med värdena 10 respektive 20.

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. Använd nyckelordet var och tilldelningsoperatorn (=) för variabeldeklaration.
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); } } }

Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 1. Kapitel 9

Fråga AI

expand

Fråga AI

ChatGPT

Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal

Suggested prompts:

Can you show me how to declare the variables using the `var` keyword?

What is the correct syntax for assigning values to variables in JavaScript?

Can you provide an example of declaring and assigning these variables?

Awesome!

Completion rate improved to 1.59

bookUtmaning: Variabeldeklaration

Svep för att visa menyn

Fyll i koden genom att deklarera variablerna value_1 och value_2 med värdena 10 respektive 20.

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. Använd nyckelordet var och tilldelningsoperatorn (=) för variabeldeklaration.
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); } } }

Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 1. Kapitel 9
some-alt