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
Accountancy,
7 months ago
Computer Science,
7 months ago
Math,
7 months ago
Math,
1 year ago
Math,
1 year ago
History,
1 year ago
Chemistry,
1 year ago