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