a1p2(introprog1620 perry)

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

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(&quot;The distance between the two points is &quot; &quot;%5.2f \n&quot;,distance); /*area computed*/ area = (distance*distance)*(4*atan(1)); /*print area*/ printf(&quot;The area is&quot; &quot;%5.2f \n&quot;,area); /* Exit program. */ return 0; } /*------------------------------------------------------------*/...
View Full Document

This homework help was uploaded on 04/08/2008 for the course ECE 1620 taught by Professor Perry during the Spring '08 term at Villanova.

Ask a homework question - tutors are online