Question

The variable X starts with the value 0. The variable Y starts with the value 5. Add 1 to X. Add 1 to Y. Add X and Y, and store the result in Y. Display the value in Y on the screen.

Output #1:

Pseudocode #1:

The logic of the question makes sense, but I do not even know where to start. Can someone explain and/or help me?

Was it helpful?

Solution

Pseudocode:

X = 0;
Y = 5;
X = X + 1;
Y = Y + 1;
Y = X + Y;
display(Y);

I'll leave the maths to you...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top