Hello, I’m working on this task:
Write a program that calculates and outputs to the screen the distance from your position (blue dot) to the destination (red dot).
Here is my code:
x= 175+175
y=75
z=x+y
print(z)
Can anyone please help me to solve it?
From your code it seems you’re adding the value of height twice and width once, you’ve also forgotten the semicolon at the end of your int type variable. You can fix this issue by following the dotted line.
int width = 3*75;
int height = 175;
int result = width + height;
Console.WriteLine(result);