Saturday, January 24, 2015

FUNCTIONS WITHOUT ARGUMENTS & WITH RETURN TYPE

PROGRAM:

#include<stdio.h>

#include<math.h> float area()

{

int a,b,c; float s,ar;

printf("Enter 3 Sides\n"); scanf("%d%d%d",&a,&b,&c); s=(a+b+c)/2; ar=sqrt(s*(s-a)*(s-b)*(s-c)); return ar;


}

main()
{

float a; a=area();
printf("The Area of Triangle is %f\n",a);
}

OUTPUT:

Enter 3 Sides 12 8 7


The Area of Triangle is 19.748418

No comments:

Post a Comment