|
|
|
/
*
*
ffloat.c
*
C program will find
hypotenuse
of a right triangle.
*
Function uses a type float argument and accepts
*
input from the keyboard with the scanf function.
*
Copyright (c) Chris H. Pappas and William H. Murray, 1998
*
/
#include <stdio.h>
#include <math.h>
void vhypotenuse(float fx,float fy);
int main()
{
float fxlen,fylen;
printf(Enter the base of the right triangle. \n);
scanf(%f,&fxlen);
printf(Enter the height of the right triangle. \n);
scanf(%f,&fylen);
vhypotenuse(fxlen,fylen);
return (0);
}
void vhypotenuse(float ft,float fu)
{
double dresult;
dresult=
hypot
((double) ft,(double) fu);
printf(The hypotenuse of the right triangle is %g \n,
dresult);
}
|
|
|