hi Uday
1 and 2 are int values, we will get 1/2 as 0 only... if you want to getthe
correct value in float ,make one int as float. float of 1 is 1.0
so your equation will be like this
aot=1.0/2*b*h;
Uday Oberio wrote:
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 thanresult come
but the main thing is i want to know that is there anypossibilities that we can
run same prog with 1/2...can result come with1/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]
--------------030906030704030908090002--
---------------------------------
Don't let your dream ride pass you by. Make it a reality with Yahoo! Autos.
[Non-text portions of this message have been removed]