Mail Archives: djgpp/1999/01/11/14:51:49
Jason Mullins (cyberj23 AT erols DOT com) wrote:
: Hello -
: Im new to programming. I wondering why I can't get this code to
: count backwards form 6 to 0 and exit. I will start at 6, and go down to
: negitives (becuase it's a "int"). I was told that it could be done in a
: while loop. not a do while. Any suggestions?
It can be done in a do while too.
: Thanx in advance.
:
: Jason Mullins
:
: #include <stdio.h>
:
: int main()
: {
: int count;
: int cycle;
: cycle = 0;
: count = 6;
: while (count <= 6, cycle = 6)
Try "while(0 <= count)" instead. Or "while(cycle <= 6)" Or even
"while(count*2 + 5*M_PI - cycle, !(7 <= count))" if you are feeling
adventurous!
: {
: printf("The value of count is %d\n");
: count = count--;
: cycle = cycle++;
: }
: return 0;
: }
Right,
MartinS
- Raw text -