Help me to execute this c program

priyasub's Avatar
Newbie Member
i need a help in executing a for loop... the output should be in the form as below

how to do it..
im new to learn c language..
help me
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
You created the same thread more than once and also in the wrong forum and I have moved them into C-C++ forum for better response.

Also regarding your question I guess you need to look into using loops because this question is just a one line program using loops
xpi0t0s's Avatar, Join Date: Aug 2004
Build it up bit by bit.

Start with a for loop that displays a number of asterisks. Make it so that you can set the number, e.g.
int num=10; // this determines the number we print
for ( /* ??? but reference num */)
  /* ??? */
If that's too difficult then just write a loop that displays a fixed number of asterisks, say 5. Then replace the 5's with num and you can experiment by changing the value of num a few times to make sure it works.

Then enclose that lot in a loop that varies the value of num. By the looks of it each line is one asterisk longer than the previous so that should be easy.