How can you assign a value to a variable in C#?
Experience Level: Junior
Tags: C#
Answer
To assign a value to a variable, use the operator '='. In the code below the value 10 will be assigned to the variable x and the value 20 will be assinged to the variable y. It's like in math. The value from the right hand side of the assignment operator '=' gets assigned to the left hand side of the assignment operator.
Related C# job interview questions
How can you find out what is the variable type?
C# JuniorHow can you declare a variable?
C# JuniorWhat is a 'var' keyword in C# good for?
C# JuniorWhat is a variable?
C# JuniorWhat is the 'new' keyword used for in C#?
C# Junior
Chat
Oh, the operator is not available. Leave us your comments. We will answer all your questions as soon as possible.
Anonymous
Καλησπέρα.
Καλησπέρα.
Anonymous
the infinteis -3/15 so 1triition / infinet
the infinteis -3/15 so 1triition / infinet
Anonymous
e
e
Anonymous
<a href="https://inspirum.pl "
<a href="https://inspirum.pl "
Anonymous
[url]https://inspirum.pl[/url]
[url]https://inspirum.pl[/url]
LaceJaguar65
e
e
LaceJaguar65
e
e
LaceJaguar65
e
e
LaceJaguar65
e
e
LaceJaguar65
e
e
LaceJaguar65
e
e
LaceJaguar65
e
e
LaceJaguar65
e
e
LaceJaguar65
e
e
LaceJaguar65
e
e
LaceJaguar65
e
e
LaceJaguar65
e
e
LaceJaguar65
e
e
LaceJaguar65
e
e
LaceJaguar65
e
e
LaceJaguar65
e
e
LaceJaguar65
e
e
LaceJaguar65
e
e
LaceJaguar65
e
e
LaceJaguar65
e
e