a1p1(introprog) - /* Print distance. */ 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=1e200, y1=5e200, x2=4e200, y2=7e200, side_1, side_2, distance; /* Compute sides of a right triangle. */ side_1 = x2 - x1; side_2 = y2 - y1; distance = sqrt(side_1*side_1 + side_2*side_2);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: /* Print distance. */ printf("The distance between the two points is " "%5.2g \n",distance); /* 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