Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 1

a program to calculate the area of a triangle given three sides

#include<stdio.h>
int area (int a,int b,int c, int s)
Void void main()
{
int a,b,c,s,area;
int a;
int b;
int c;
int s;
int area;
Printf("enter the values of the sides of the triangle\n");
sScanf("%d%d%d",&a,&b,&c);
S=(a+b+c)/2;
aArea=squrt(s*(s-a)*(s-b)*(s-c));// calling function and passing parameters
Pprintf("the area of the triangle is %d",area);
getch();
}

I HAVE FOUND A PROGRAM THAT CAN HELP YOU TO FIND THE AREA OF
THE TRIANGLE; HAVE A; LOOK AT IT AND MODIFY THE PROGRAM, DON’T
COPY AND PASTE BUT DO SOME ADJUSTMENTS FOR THIS PROGRAM.
SEE BELOW

#include
#include
#include
voidmain()
{
clrscr();
int a,b,c,s,area;
printf("enter the values of the sides of the triangle\n");
scanf("%d%d%d",&a,&b,&c);
s=(a+b+c)/2;
area=squrt(s*(s-a)*(s-b)*(s-c));
printf("the area of the triangle is %d",area);
getch();
}

You might also like