Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in C programming Define a structure variable pt which represents a point in Cartesian xy-plane using its coordinates (x, y). Using pt, define an array

in C programming Define a structure variable pt which represents a point in Cartesian xy-plane using its coordinates (x, y). Using pt, define an array of 3 structures called tri which represents the 3 vertices of a triangle in the xy-plane.

Write a function with prototype which accepts the tri array as an argument and returns the perimeter of the triangle.

Use the following co-ordinates for the 3 points (-3.0,5.0) (4.0,2.0) (-1.0,-3.0).

Print the calculated perimeter in the main() using precision of 2 decimal points.

Note: The distance between two cartesian points of coordinates (x1,y1) & (x2.y2) is calculated as follows

s=

(x1x2)2+(y1y2)2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions