Rhombus Pattern Program In Java Language
class Demo{
public static void main(String args[])
{
int n=5;
for(int i=1; i<=n; i++){
//spaces
for(int j=1; j<=n-i; j++){
System.out.print(" ");
}
for(int j=1; j<=n; j++){
System.out.print("*");
}
System.out.println();
}
}
}
OUTPUT:
*****
*****
*****
*****
*****
Comments
Post a Comment