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