Write a Java Program to print mirror image of Right Angle Triangle
*
**
***
****
*****
package mobbiinfo.MirrorImageOfRightAngleTriangle;
public class MirrorImageOfRightAngleTriangle {
public static void main(String[] args) {
for(int i=5;i>=1;i--){
for(int j=1;j<=5;j++){
if((i+j)>5){
System.out.print(" ");
}
}
for(int k=1;k<=5;k++){
if((i+k)<=6){
System.out.print("*");
}
}
System.out.println();
}
}
}
Comments
Post a Comment