How to pass arguments

Didn’t completely understand your question but it seems this is what to tend to achieve :

#include <stdio.h>
 #include <math.h>
 double calculateArea(double, double, double, double, double, double);


int main () {
double x1, x2, x3, y1, y2, y3, area1, premiter1;
printf("Enter the coordinate planes");
scanf("%lf", &x1);
scanf("%lf", &y1);
scanf("%lf", &x2);
scanf("%lf", &y2);
scanf("%lf", &x3);
scanf("%lf", &y3);
area1 = calculateArea(x1, y1, x2, y2, x3, y3);
printf("Area : %lf", area1);
return 0;
}

double calculateArea(double x1, double y1, double x2, double y2, double x3, double y3) { 
double area;
//your logic here.
return area;

} 

Similarly you can work with perimeter.

Browse More Popular Posts

Leave a Comment