Date: Mon, 6 Dec 1999 15:58:45 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Jason Yip cc: djgpp AT delorie DOT com Subject: Re: Whatever the input, the output is always 0 In-Reply-To: <82gbc8$gq0$1@imsp026.netvigator.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Mon, 6 Dec 1999, Jason Yip wrote: > whatever I input, say 4.0 5.0, the output is always =0 . why?? [snip] > scanf("%lf%lf",a,b); Re-read the docs of `scanf': it needs a *pointer* to the variables whose values you want to read. So you need to say this: scanf("%lf %lf, &a, &b); (Note the blank between the format descriptors: it's also important in some cases.)