# Flutter Laundry App Concept | Speed Code | GitHub Link

via https://youtu.be/ioxnMhNRMp0
👨‍💻Source Code: https://ift.tt/32NlB2Y

✌Subscribe to CodeDecoders: http://bit.ly/CodeDecoders

💮Design credit: https://www.uplabs.com/

💕Hope you liked and understood the video.

📷My Instagram: https://ift.tt/34hT8DM

🌐Our Website: https://ift.tt/2pAOsKr

Recommended Editor for Flutter: https://ift.tt/1KubVvS

# C program to print Rhombus star pattern

Write a C program to print rhombus star pattern of N rows using for loop. How to print rhombus or parallelogram star pattern using for loop in C programming. Logic to print rhombus or parallelogram star pattern series in C program.

## Logic to print Rhombus star pattern

```_ _ _ _ * * * * *
_ _ _ * * * * *
_ _ * * * * *
_ * * * * *
* * * * *```

Before I decode the logic of this pattern, have a close look of the pattern. Place your mouse cursor on to the pattern, to count spaces. Try to decode the logic of given pattern.

If you remove trailing spaces the pattern becomes a simple square star pattern of N rows and columns. You only need to add logic of printing spaces with the existing logic of square star pattern.

The pattern consists `N - i` spaces per row (where i is the current row number).

Step by step descriptive logic to print rhombus star pattern

1. Input number of rows from user. Store it in a variable say rows.
2. To iterate through rows, run an outer loop from 1 to rows. Define a loop with structure `for(i=1; i<=rows; i++)`.
3. To print spaces, run an inner loop from 1 to `rows - i`. Construct a loop with structure `for(j=1; j<=rows - i; j++)`. Inside this loop print space.
4. To iterate through columns for printing stars. Run another inner loop from 1 to rows. Define another loop with structure `for(j=1; j<=rows; j++)`. Inside this loop print star.
5. After printing all columns of a row move to next line i.e. print new line.

## Program to print rhombus star pattern

``````/**
* C program to print Rhombus star pattern series
*/

#include <stdio.h>

int main()
{
int i, j, rows;

/* Input number of rows from user */
printf("Enter rows: ");
scanf("%d", &rows);

for(i=1; i<=rows; i++)
{
/* Print trailing spaces */
for(j=1; j<=rows - i; j++)
{
printf(" ");
}

/* Print stars after spaces */
for(j=1; j<=rows; j++)
{
printf("*");
}

/* Move to the next line */
printf("\n");
}

return 0;
}``````

Output

```Enter rows: 5
*****
*****
*****
*****
*****```

# C program to print hollow square or rectangle star pattern

Write a C program to print hollow square star(*) pattern series using for loop. How to print hollow square star pattern of N rows using for loop in C programming. Logic to print empty square star pattern in C program.

## Logic to print hollow square star pattern

```*****
*   *
*   *
*   *
*****```

The above pattern is similar to square star pattern of N rows and N columns. Here star is printed only for first and last column or for first and last row.

Step by step descriptive logic to print empty square star pattern.

1. Input number of rows to print from user. Store it in a variable say N.
2. To iterate through rows, run an outer loop from 1 to N. For that define loop with structure `for(i=1; i<=N; i++)`.
3. To iterate through columns, run an inner loop from 1 to N. Define loop with structure `for(j=1; j<=N; j++)`.
4. Inside inner loop print star for first and last row or for first and last column. Which is print star if `i==1` or `i==N` or `j==1` or `j==N`, otherwise print space.
5. After printing all columns of a row, move to next line i.e. print a blank line after inner loop.

## Program to print hollow square pattern

``````/**
* C program to print hollow square star pattern
*/

#include <stdio.h>

int main(){
int i,j,n;
/* Input number of rows from user */
printf("Enter Number: \n");
scanf("%d",&n);
/* Iterate over each row */
for(i=1;i<=n;i++)
{
/* Iterate over each column */
for(j=1;j<=n;j++)
{
if(i==1||i==n||j==1||j==n)
printf("* "); // one Star and one space
else
printf("  "); //two spaces
}

printf("\n");
}
return 0;
}``````

## Output

Happy Code Decoding 😉 ….

# C program to print square or rectangle star pattern

Write a C program to print square star(*) pattern series of N rows.

Logic to print square star pattern of N rows in C programming.

## Logic to print square star pattern

* * * * *
* * * * *
* * * * *
* * * * *
* * * * *

Have a close look to the pattern first so that you can understand the logic we are going to understand.

The pattern is a matrix of N rows and columns containing stars(asterisks). Here, you need to iterate through N rows, and for each row iterate for N columns.

Step by step descriptive logic to print the square number pattern.

1. Input number of rows from user. Store it in some variable say N.
2. To iterate through rows, run an outer loop from 1 to N. The loop structure should be similar to `for(i=1; i<=N; i++)`.
3. To iterate through columns, run an inner loop from 1 to N. Define a loop inside above loop with structure `for(j=1; j<=N; j++)`.
4. Inside inner loop print *.
5. After printing all columns of a row move to next line i.e. print a new line.

Let us implement the given pattern in C program.

## Program to print square star pattern

``````/**
* C program to print square star pattern
*/

#include <stdio.h>
int main()
{
int i, j, N;

/* Input number of rows from user */
printf("Enter number of rows: ");
scanf("%d", &N);

/* Iterate through N rows */
for(i=1; i<=N; i++)
{
/* Iterate over columns */
for(j=1; j<=N; j++)
{
/* Print star for each column */
printf("*");
}

/* Move to the next line/row */
printf("\n");
}

return 0;
}``````

## Output

Happy Code Decoding 😉 …