Xref: news2.mv.net comp.os.msdos.djgpp:8103 From: "Bob Platko" Newsgroups: comp.os.msdos.djgpp Subject: Scanf doesn't work Date: 31 Aug 1996 14:38:49 GMT Organization: Netcom Lines: 64 Message-ID: <01bb974a$24b5f820$24c5b7c7@platko.ix.netcom.com> NNTP-Posting-Host: clv-oh1-04.ix.netcom.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Anyone been having problems with scanf? When using multiple scanf's in a program, only the input from the last scanf is saved in the varible. My code works fine in Borland, but not in DJGPP! What's wrong? ---Code--- #include #include void main (void) { unsigned short i; unsigned short k,l; unsigned short j; unsigned short remainder; unsigned long num_of_prime_numbers=0; signed char placeholder; printf("Enter the range of the prime numbers\n"); scanf("%u",&k); scanf("%u",&j); /*In DJGPP, only 'j' is stored. 'k' is zero? */ printf("Prime numbers between %d ",k); printf("and %d.",j); for(i=k; i