24x - Learn to Increment & Decrement Variables in Java - Exercise 1

preview_player
Показать описание

In this lesson, we will get practice with how to increment a variable and decrement a variable when writing Java code.
Рекомендации по теме
Комментарии
Автор

it was almost the same as mine, the difference is that i declared another variable refering the number 2.

public static void main(String[] args) {
int number1, number2 = 2, TOTAL;

for(number1 = 140; number1 >= 130; number1--) {
TOTAL = number1*number2;
System.out.println(number1 + " times " + number2 + " equals " + TOTAL);
}

nicolasurrutiaburgos
Автор

Hi! Thanks for the videos. One question, I did "Number/2". Does it work too?

rodriguezrodrigo
join shbcf.ru