11-30-2004, 12:04 PM | #1 (permalink) |
Junkie
|
[C] For Loop
Im pretty much a beginner at this, and I just wanted to know if it is possible to
to print a series of astericks, such as the below design which I just made up, using the for loop. ** ** ** The structure of the for loop is: for (i=0; i <= limit; i++) The limit variable it would seem like it should be equal to 2, but then here' s where I get stuck, how do you compare a character such as the * to a limit which is an integer, it doesn't really make sense, so I was wondering if this possible, or if should I try some other alternative. |
11-30-2004, 12:14 PM | #2 (permalink) |
Junkie
|
for(i=0; i<3; i++)
printf("**\n"); That should work, but I just typed it up real quick without thinking too much. Also, why would you want to compare a character to an integer in the first place?
__________________
The most important thing in this world is love. Last edited by Stiltzkin; 11-30-2004 at 12:17 PM.. |
Tags |
loop |
|
|