write a program to display from 50 to 1 using for loop
Answers
Answered by
1
Explanation:
How will I write a for loop in Java that would display the numbers 50 to 100?
Well, If you just want to display from 50 to 100 then you can write this
class loop
{
public static void main(String args[])
{
for(int i = 50;i <= 100; i++){
System.out.print(i+" "); // if you want to print in same line
}
for(int i = 50;i <= 100; i++){
System.out.println(i+" "); // if you want to print vertically
}
}
please don't think bad about me I am an hacker
Similar questions