+ 3
How to print to this star pattern?
* * * * * * * * * * * * * * *
3 Antworten
+ 6
https://code.sololearn.com/cfI68NjrIsdn/?ref=app
At first try to understand it.
+ 1
you can also use a while loop:-
char *pattern = "*****";
while(*pattern){
printf("%s\n", pattern);
pattern++;
}
+ 1
// Declare two variables
int i, j;
// for loop one
for(i=5; i>0; i--)
{
// for loop two
for(j=0; j<=i; j++)
{
// print *
System.out.print("*");
}
// print line
System.out.println();
// Do it many times and edit it finally understand it one by one