Set two variables to the same value in one line of code

Example

Variablealpha=1; Variablebeta=1;

Can this be written like

Variablealpha=variablebeta=1;

Instead? I haven't had luck writing it in one line. Thanks guys

Can this be written like

Variablealpha=variablebeta=1;

Instead?

Yes.

I haven't had luck writing it in one line.

First, there is no luck involved. Second, there is no benefit in doing that. The code is not faster, smaller, or easier to read.

Variablealpha=1;
Variablebeta=1;

Both have an upper case V.

Variablealpha=variablebeta=1;

But here you have "variablebeta". If you declared it as Variablebeta but use variablebeta in the assignment statement, it will generate an error.

Pete