#include
int choice,p,a,b,c,area,base, height;
int main()
{
printf("This program will get the perimeter and are of Triangle\n");
printf("Choices\n");
printf("1.] Perimeter\n");
printf("2.] Area\n");
printf("Enter Choice [1 or 2]: ");
scanf("%d",&choice);
if (choice == 1)
{
printf("Enter Side A: ");
scanf("%d",&a);
printf("Enter Side B: ");
scanf("%d",&b);
printf("Enter Side C: ");
scanf("%d",&c);
p = a + b + c;
printf("The perimeter of the area of a triangle is %d",p);
}
if (choice == 2)
{
printf("Enter Base: ");
scanf("%d",&base);
printf("Enter Height: ");
scanf("%d",&height);
area = (base * height)/2;
printf("The area of a triangle is %d",area);
}
getch();
return 0;
}
No comments:
Post a Comment