14.4k views
5 votes
How do you increase the number of tries by one?

tries.add(1)

tries = tries + 1

tries = 1

User IHarshil
by
3.6k points

1 Answer

5 votes

Answer:

tries = tries + 1

Step-by-step explanation:

This is a universal way to increment your variable. In some languages, the following notation also works:

tries++;

tries += 1;

Again, it depends upon the language you are using. Each language has it's own syntax.

User Sven Hohenstein
by
3.8k points