-
'For Loop' example
I am learning c for last one week. While learning for loop one of my friend challenged to code a program with two for loop that produce output like below......
This Is For-loop example:
* * * *
* * *
* *
*
I tried it but had to use more for-loops. Any idea
-
-
Quote:
Originally Posted by
milanparmar
my friend challenged
It's nice that you're such good friends with your teacher...
But think about it. You have a certain number of lines and a certain number of asterisks per line. So you need one loop for the number of lines and one for the number of asterisks per line.
QuantumPete