delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/01/11/12:11:34

From: Jason Mullins <cyberj23 AT erols DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: I can't seem to get this to work!
Date: Mon, 11 Jan 1999 12:06:09 +0000
Lines: 29
Message-ID: <3699E931.A63558C6@erols.com>
Mime-Version: 1.0
X-Trace: TIfgtrlvziTj6l8COt90izp6+efSTlyuTKj9GXEk8ho=
X-Complaints-To: abuse AT rcn DOT com
NNTP-Posting-Date: 11 Jan 1999 17:08:08 GMT
X-Mailer: Mozilla 4.07 [en] (Win95; I)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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 <stdio.h>

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;
}


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019