0

How to order a command to do x++ multiple times?

int x = 6; x++; Console.WriteLine(x); How to change it by keeping x++ to get 9 without writing 3 lines of x++

16th Sep 2016, 6:04 PM
Eustace
2 Réponses
0
in 1 line: x += 3 (it is a shorthand for x = x +3) OR by using a cycle: for (; x < 9; x++) Actually an increment (x++) used only for addind 1 to a variable.
21st Sep 2016, 5:41 PM
Алексей Сачек
Алексей Сачек - avatar
0
for(x=6;x<=9;x++)
26th Apr 2017, 10:30 AM
mei
mei - avatar