Date: Mon, 6 Dec 1999 10:20:13 -0500 (EST) From: Daniel Reed Sender: n AT celery DOT n DOT ml DOT org To: 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: Precedence: first-class 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?? ) pls tell me. thx.. scanf() puts values into the memory pointed to by the arguments you give it, and in your code it's trying to put the values into the memory locations pointed to by your uninitialized a and b variables (ie, it's treating a and b as pointers). What you really want is to pass pointers *to* a and b to scanf. ) main () ) {double a,b,s; ) printf("Enter the sides of the triangle: "); ) scanf("%lf%lf",a,b); scanf("%lf%lf, &a, &b); -- Daniel Reed Misspelled? Impossible. My modem is error correcting!