Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Help me to execute this c program (http://www.go4expert.com/forums/help-execute-c-program-t17254/)

priyasub 1May2009 13:36

Help me to execute this c program
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 1May2009 13:39

Re: Help me to execute this c program
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 2May2009 02:57

Re: Help me to execute this c program
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.

All times are GMT +5.5. The time now is 10:41.