15,920,704 members
See more:
How to print this pattern
```* * * *
* * *
* * * *
* * *```

What I have tried:

Yap I tried to much solve this problem but i can't solve please help me to solve this problem
Posted
Updated 24-Mar-23 3:10am
v8
Patrice T 23-Mar-23 6:42am
show actual output.
Ralf Meier 23-Mar-23 8:01am
For future questions :
"Help me to solve this problem" is not a qualified description or a title with sense.
Perhaps you think about that ...

## Solution 1

Alternating four stars, with three ones?
Are you kidding?
Use Google: search for "basic console I/O with C#".

## Solution 4

The trick with these sort of patterns where there is particular character separated by a space is to keep track of the number of characters printed and to use the modulus operator to decide whether to print the character or the space. Things are much more simple if the lines are of the same length as you can use the modulus operator to decide when to start a new line. In your example, the lines appear to be different lengths but, by adding a space to the end of the 3 star lines, the pattern looks the same but now every line is the same length. What is more, the pattern becomes a 28 character series of alternating * and space characters with a line break on every 7th character. So it can be solved using a single `for` loop and a couple of modulus operations

## Solution 2

This is not a difficult problem. You alternate between printing four stars with three spaces, and four spaces with three stars. So a couple of simple loops will do it.

So think about what each loop needs to do and try it yourself.

v2

## Solution 3

Write a method that takes a single integer parameter and which prints that number of stars.
Test it, fix it, make sure it works for every value it might be given.
When it does, call it inside a loop with alternating numbers: 4, then 3, then 4 again, and so on.

If you are having problems getting started at all, then this may help: How to Write Code to Solve a Problem, A Beginner's Guide[^]