write an algorithm and java programming to print 5 to 1 using for loop
Answers
Answered by
0
Answer:
public class Print_1_To_5_UsingFor
{
public static void main(String[] args)
{
//print the result
System.out.println("Output is : ");
//loop to print 1 to 5.
for(int i = 1; i <= 5; i++)
{
System.out.println(i);
}
}
}
Explanation:
Similar questions