aot=1/2*b*h; Equvilent to aot = 1/(2*b*h); That why your ans is 0.00000
Your can try this aot = b*h*1/2; |-----Original Message----- |From: [email protected] [mailto:[EMAIL PROTECTED] |On Behalf Of Uday Oberio |Sent: Friday, September 14, 2007 11:55 AM |To: [email protected] |Subject: [c-prog] please reply soon( i need its urgent) | |hello everyone | | i have some problem in 'C' programming as i m very new in |this field... | | mine prog is to fing out area of triangle.... | | what i write in mine prog is | | main() | { | float aot, b,h; | clrscr(); | printf("enter base and hieght"); | scanf("%f%f",&b,&h); | aot=1/2*b*h; | printf("%f",aot); | } | | now the result is always 0.00000 instead of 1/2 i also write |.5 than result come but the main thing is i want to know that |is there any possibilities that we can run same prog with |1/2...can result come with 1/2. if yes please tell me. | thanx a lot in advance... | arun | | | |--------------------------------- | 5, 50, 500, 5000 - Store N number of mails in your inbox. Click here. | |[Non-text portions of this message have been removed] | | | |To unsubscribe, send a blank message to |<mailto:[EMAIL PROTECTED]>. |Yahoo! Groups Links | | | |
