Star printing program in Java, pattern 1 :
Code for this pattern:
public class test {
public static void main(String[] args) {
for(int i = 0; i < 10; i++){
for(int j=i+1;j>0;j--){
System.out.print("*");
}
System.out.println();
}
}
}
You can try this in C.
Post a Comment