program to print triangle
* * * * *
* * * *
* * *
* *
*
By Scanner method
Answers
Answered by
2
public class Program
{
public static void main(String[] args) {
for(int i=5;i>=1;i--){
for(int j=1;j<=i;j++){
System.out.print("*");
}
System.out.println();
}
}
}
nitish8089:
there is no need of Scanner method if you just want print this pattern
Similar questions