P
P
petrro2019-09-19 17:25:47
Informatics
petrro, 2019-09-19 17:25:47

Why is the expression written this way?

For example I have:
x=1
I need to add one to it.
Why do they write:
x=x+1
and not just:
x+1
or even like this:
x=2;

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Rsa97, 2019-09-19
@Rsa97

In algebra, the notation x=x+1 denotes an equation to be solved for x, moreover, with an empty set of solutions.
Are you confusing algebra with programming?

D
Developer, 2019-09-19
@samodum

This is not an algebraic expression, but an assignment operation.
I recommend opening a computer science textbook for the 5th grade. They are just studying it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question