Write a program to count even numbers between 20 to 40.
Answers
Answer:
In the following example we are displaying the even numbers from 1 to n, the value of n we have set here is 100 so basically this program will print the even numbers between 1 to 100.
If an integer number(never a fraction number) is exactly divisible by 2 which means it yields no remainder when divided by 2 then it is an even number. This same logic we are using here to find the even numbers. We are looping through 1 to n and checking each value whether it is evenly divisible by 2 or not, if it is then we are displaying it. To understand this program you should have the basic knowledge of for loop in Java and if statement.
mark as brainliest plzzzzz n follow me
The even numbers between 20 to 40 are :
20;22;24;26;28;30;32;34;36;38;40.
hope this helps you.....
thank you.....