- 1
I don't know what's wrong with code why it does not work??? Can someone help me please..
5 Respostas
+ 4
Console.WriteLine(x+a+y);
+ 3
Let's take a look on errors when we run the code......it's say "xay is not exist in context"....it's clear now.....that you are using a variable not EXISTED ...you haven't declare a variable named "xay" so you can't use it before declaring it
+ 2
Ok....The compiler doesn't understand like us.....when you need to out two variables or more behind each other.....you MUST have "+" ...between each other.....so....The compiler will understand that you want to out first variable behind second .....even when you want to out a space between variable ....you must write this.....
Console.Write(x+" "+y);
That line will out a value of x then space then value of y......that's it.....I hope you get it now😊☺
+ 1
You wrote variable xay, but you don't have it. If you want to output this variables write this:
Console.WriteLine(quot;x = {x}, a = {a}, y = {y}");
0
But I had declared all variables separately...
and doing so I expected a operator would be placed in between other two variables (i. e. x and y)..
what else could be done..