The trouble is that you aren't assigning anything.
Think of a variable as a pocket in your shirt, which can hold an item : a pen, a pencil, a hankie.
Unless you explicitly put something in the pocket, you can't take it out!
So try doing the operation, but putting the result into the "pocket":
int a = 1;
int b = 2;
int c = a + b;
Console.WriteLine("The value of {0} + {1} is {2}", a, b, c);
You shouldn't "mix types" unless you need to - it can cause some odd problems - so I changed the declaration of
b
from
double
to
int
to match
a
and
c
.
The final line is just a "tidy up" form or what you had: the curly brackets in the string will be replaced with the value from the list after it, using the number as a count: {0} will be replaced with the first value (in this case from the variable
a
), {1} will be replaced with the second value (in this case from the variable
b
), and so on.
Try it and see what happens!