Mail Archives: djgpp/1999/12/07/06:03:02
| From: | "Anes Hadzic" <a DOT hadzic AT bih DOT net DOT ba>
|
| Newsgroups: | comp.os.msdos.djgpp
|
| Subject: | Re: Whatever the input, the output is always 0
|
| Date: | Tue, 7 Dec 1999 10:57:48 +0100
|
| Organization: | BIHnet News Server
|
| Lines: | 28
|
| Message-ID: | <82ilp8$o4n4@ns4.bih.net.ba>
|
| References: | <82gbc8$gq0$1 AT imsp026 DOT netvigator DOT com>
|
| NNTP-Posting-Host: | dialup1-ppp247.bih.net.ba
|
| X-Priority: | 3
|
| X-MSMail-Priority: | Normal
|
| X-Newsreader: | Microsoft Outlook Express 5.00.2014.211
|
| X-MimeOLE: | Produced By Microsoft MimeOLE V5.00.2014.211
|
| To: | djgpp AT delorie DOT com
|
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
| Reply-To: | djgpp AT delorie DOT com
|
Jason Yip <manman AT netteens DOT net> wrote in message
news:82gbc8$gq0$1 AT imsp026 DOT netvigator DOT com...
> whatever I input, say 4.0 5.0, the output is always =0 . why??
> pls tell me. thx..
>
> #include <stdio.h>
> #include <math.h>
> double side (double a,double b)
> {return sqrt(pow(a,2)+pow(b,2));}
>
> main ()
> {double a,b,s;
> printf("Enter the sides of the triangle: ");
> scanf("%lf%lf",a,b);
> s=side(a,b);
> printf("Hyotenuse: %.1f",s);
> }
>
>
>
Try with:
scanf("%lf%lf", &a, &b);
- Raw text -