{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

a1p2(introprog1620 perry)

a1p2(introprog1620 perry) - printf"The distance...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
#include <stdio.h> #include <math.h> int main(void) { /* Declare and initialize variables. */ double x1=1, y1=5, x2=4, y2=7, side_1, side_2, distance, area; /* Compute sides of a right triangle. */ side_1 = x2 - x1; side_2 = y2 - y1; distance = sqrt(side_1*side_1 + side_2*side_2); /* Print distance. */
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: printf("The distance between the two points is " "%5.2f \n",distance); /*area computed*/ area = (distance*distance)*(4*atan(1)); /*print area*/ printf("The area is" "%5.2f \n",area); /* Exit program. */ return 0; } /*------------------------------------------------------------*/...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online