Wednesday, 18 January 2012

Program To Find Area Of Traingle Using Float Variable


#include<iostream.h>
#include<conio.h>
#include<math.h>
float sum(float x,float y,float z);
main()
{
clrscr();
float a,b,c,s,p;
cout<<"Enter the FIRST Number=";
cin>>a;
cout<<"Enter the SECOND Number=";
cin>>b;
cout<<"Enter the THIRD Number=";
cin>>c;
s=sum(a,b,c);
cout<<"AREA OF TRANGLE IS THE RESULT="<<s;
getch();
 }
float sum(float x,float y,float z)
{
float w,t;
w=(x+y+z)/2;
t=sqrt(w*(w-x)*(w-y)*(w-z));
return w,t;
}

No comments:

Post a Comment