Java Program to print 1 to 100
Answers
Answered by
1
Answer:
10 20 30 40 50 60 70 80 90
Explanation:
tu noob ha be
Answered by
3
Explanation:
public class DisplayEvenNumbersExample1
{
public static void main(String args[])
{
int number=100;
System.out.print("List of even numbers from 1 to "+number+": ");
for (int i=1; i<=number; i++)
{
//logic to check if the number is even or not
//if i%2 is equal to zero, the number is even
if (i%2==0)
{
System.out.print(i + " ");
}
}
}
}
Similar questions