Message-ID: <002001be3d9e$c010b4c0$c1d80ad0@default> From: "Steve Axsom" To: Subject: Re: I can't seem to get this to work! Date: Mon, 11 Jan 1999 15:12:41 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Reply-To: djgpp AT delorie DOT com -----Original Message----- From: Jason Mullins Newsgroups: comp.os.msdos.djgpp To: djgpp AT delorie DOT com Date: Monday, January 11, 1999 1:03 PM Subject: I can't seem to get this to work! >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? > > >Thanx in advance. > >Jason Mullins > >#include > >int main() >{ >int count; >int cycle; > cycle = 0; > count = 6; > while (count <= 6, cycle = 6) > { > printf("The value of count is %d\n"); > count = count--; > cycle = cycle++; > } > return 0; >} > > > I made a few revisions to your code. I donno what you were using the int cycle for, so I hope this is how you want- #include int main() { int count=6; while (count>=0) { printf("The value of count is %i\n",count); count--; } return 0; } -Shane