Hey guys and girl i need your help in program only in C CODE user press only odd numbers then the following result has been shown like

if 3 then

***
* *
***

if 5 then
*****
* *
*****
* *
*****
PLZ HELP ME >>>> Thanks

f 5 then

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

PLZ HELP ME >>>> Thanks

remember in even column only 1st and last star will print not else there are spaces among them.

Edited 3 Years Ago by mike_2000_17: Fixed formatting

sorry, your question is not urgent.

and the fact that you have spammed it here multiple time, now just moved you to the very back of the queue.

There's a queue?

That's mighty generous of you, I was just going with "ignore" ;)

Comments
well, to be honest, it's the "ignore yo' ass" queue....

Seems like you could scanf() and get a number from the user

and then use a for loop to print out the lines of *'s, alternating between the user's number of *'s, and two *'s.

So every time your iterator in the loop is even, you want the user's number of *'s, and when the iterator is odd, you want just two *'s.

i % 2 == 0 is a very good test you might use, to see if the iterator i is even or not.

Give that a try and post up your code.

AND USE CODE TAGS AROUND YOUR CODE - ALWAYS

Edited 6 Years Ago by Adak: n/a

i need a solution if anyone have plz

Then write one yourself. Take the hints already given and start coding. Nobody here is going to write your program for you.

This article has been dead for over six months. Start a new discussion instead.