C Programing Write Function Getdata User Input Length Perpendicular Height Triangle Retur Q37128375

C programing——–

a. Write a function getData() for user to input the length andthe perpendicular height of a triangle. Return the length andheight to the calling function.

b. Write a function trigArea() to calculate the area of atriangle. Return the area to the calling function.

c. Write a function displayData() to print the length, height,and the area of a triangle;

d. Write the main() function to call getData(),call trigArea()and call displayData().

Please modify my code…

#include <stdio.h>

float getData();
float trigArea();
float displayData();

int main()
{
    float length, perpen_height;
    float area;

   getData(&length,&perpen_height);
    area= trigArea(length, perpen_height);

    return 0;
}

float getData()
{
    float leng;
    float height;

    printf(“Enter the length of a triangle:”);
    scanf(“%f”,&leng);

    printf(“nEnter the perpendicular

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.