1. inches to feet
/* This program will estimate height of person */
/* based on femur and humerus length */
#include <stdio.h>
#include <math.h>
int main(void)
{
/* Declare variables. */
double femur, femur_ht_f, femur_ht_m, humerus, humerus_ht_f,
humerus_ht_m, femf,humf,femm,humm;
/* Get user input from the keyboard. */
printf("Enter Values in Inches. \n");
printf("Enter femur length: \n");
scanf("%lf",&femur);
printf("Enter humerus length: \n");
scanf("%lf",&humerus);
/* Compute height estimates. */
femur_ht_f = femur*1.94 + 28.7;
femur_ht_m = femur*1.88 + 32;
humerus_ht_f = humerus*2.8 + 28.2;
humerus_ht_m = humerus*2.9 + 27.9;
femf=(femur_ht_f/12);
femm=(femur_ht_m/12);
humf=(humerus_ht_f/12);
humm=(humerus_ht_m/12);
/* Print height estimates. */
printf("\nHeight Estimates in Feet \n");
printf("Femur Female Estimate: %5.1f \n",femf);
printf("Femur Male Estimate: %5.1f \n",femm);
printf("Humerus Female Estimate: %5.1f \n",humf);
printf("Humerus Male Estimate: %5.1f \n",humm);
/* Exit program. */
return 0;}
2. feet to cm to feet
/* This program will estimate male and female height*/
/* based on femur and humerus lenghts*/
#include <stdio.h>
#include <math.h>
int main(void)
{
/* Declare variables. */
double femur, femur_ht_f, femur_ht_m, humerus, humerus_ht_f,
humerus_ht_m, femf,humf,femm,humm;
/* Get user input from the keyboard. */
printf("Enter Values in Feet. \n");
printf("Enter femur length: \n");
scanf("%lf",&femur);
printf("Enter humerus length: \n");
scanf("%lf",&humerus);
/* Compute height estimates. */
femur_ht_f = ((femur*30.48)*2.47+54.10);
femur_ht_m = ((femur*30.48)*2.32+65.53);
humerus_ht_f = ((humerus*30.48)*3.08+64.67);
humerus_ht_m = ((humerus*30.48)*2.89+78.10);
femf=(femur_ht_f/30.48);
femm=(femur_ht_m/30.48);
humf=(humerus_ht_f/30.48);
humm=(humerus_ht_m/30.48);
/* Print height estimates. */
printf("\nHeight Estimates in Feet \n");
printf("Femur Female Estimate: %5.1f \n",femf);
printf("Femur Male Estimate: %5.1f \n",femm);
printf("Humerus Female Estimate: %5.1f \n",humf);
printf("Humerus Male Estimate: %5.1f \n",humm);
/* Exit program. */
return 0;}
3 Inches to feet and inches
/* This program will estimate height of person */
/* based on femur and humerus length */
#include <stdio.h>
#include <math.h>
int main(void)
{
/* Declare variables. */
double femur, femur_ht_f, femur_ht_m, humerus, humerus_ht_f,humerus_ht_m, femf,humf,femm,humm,femfft,femmft,humfft,hummft;
/* Get user input from the keyboard. */
printf("Enter Values in Inches. \n");
printf("Enter femur length: \n");
scanf("%lf",&femur);
printf("Enter humerus length: \n");
scanf("%lf",&humerus);
/* Compute height estimates. */
femur_ht_f = femur*1.94 + 28.7;
femur_ht_m = femur*1.88 + 32;
humerus_ht_f = humerus*2.8 + 28.2;
humerus_ht_m = humerus*2.9 + 27.9;
femf=(femur_ht_f);
femm=(femur_ht_m);
humf=(humerus_ht_f);
humm=(humerus_ht_m);
femfft=(femur_ht_f/12);
femmft=(femur_ht_m/12);
humfft=(humerus_ht_f/12);
hummft=(humerus_ht_m/12);
/* Print height estimates. */
printf("\nHeight Estimates in Inches \n");
printf("Femur Female Estimate: %5.1f \n",femf);
printf("Femur Male Estimate: %5.1f \n",femm);
printf("Humerus Female Estimate: %5.1f \n",humf);
printf("Humerus Male Estimate: %5.1f \n",humm);
printf("\nHeight Estimates in Feet \n");
printf("Femur Female Estimate: %5.1f \n",femfft);
printf("Femur Male Estimate: %5.1f \n",femmft);
printf("Humerus Female Estimate: %5.1f \n",humfft);
printf("Humerus Male Estimate: %5.1f \n",hummft);
/* Exit program. */
return 0;}
4 inches and feet to feet and inches
/* This program will estimate height of person */
/* based on femur and humerus length */
#include <stdio.h>
#include <math.h>
int main(void)
{
/* Declare variables. */
double femur, femur_ht_f, femur_ht_m, humerus, humerus_ht_f,humerus_ht_m, femf,humf,femm,humm,femfft,femmft,humfft,hummft,femur2, femur_ht_f2, femur_ht_m2, humerus2, humerus_ht_f2,humerus_ht_m2, femf2,humf2,femm2,humm2,femfft2,femmft2,humfft2,hummft2;;
/* Get user input from the keyboard. */
printf("Enter Values in Inches. \n");
printf("Enter femur length: \n");
scanf("%lf",&femur);
printf("Enter humerus length: \n");
scanf("%lf",&humerus);
printf("Enter Values in Feet. \n");
printf("Enter femur2 length: \n");
scanf("%lf",&femur2);
printf("Enter humerus2 length: \n");
scanf("%lf",&humerus2);
/* Compute height estimates. */
femur_ht_f = femur*1.94 + 28.7;
femur_ht_m = femur*1.88 + 32;
humerus_ht_f = humerus*2.8 + 28.2;
humerus_ht_m = humerus*2.9 + 27.9;
femf=(femur_ht_f);
femm=(femur_ht_m);
humf=(humerus_ht_f);
humm=(humerus_ht_m);
femfft=(femur_ht_f/12);
femmft=(femur_ht_m/12);
humfft=(humerus_ht_f/12);
hummft=(humerus_ht_m/12);
femur_ht_f2 = ((femur2*12)*1.94)+ 28.7;
femur_ht_m2 = ((femur2*12)*1.88) + 32;
humerus_ht_f2 = ((humerus2*12)*2.8) +28.2;
humerus_ht_m2 = ((humerus2*12)*2.9) + 27.9;
femf2=(femur_ht_f2);
femm2=(femur_ht_m2);
humf2=(humerus_ht_f2);
humm2=(humerus_ht_m2);
femfft2=(femur_ht_f2/12);
femmft2=(femur_ht_m2/12);
humfft2=(humerus_ht_f2/12);
hummft2=(humerus_ht_m2/12);
/* Print height estimates. */
printf("\nHeight Estimates in Inches \n");
printf("Femur Female Estimate: %5.1f \n",femf);
printf("Femur Male Estimate: %5.1f \n",femm);
printf("Humerus Female Estimate: %5.1f \n",humf);
printf("Humerus Male Estimate: %5.1f \n",humm);
printf("\nHeight Estimates in Feet \n");
printf("Femur Female Estimate: %5.1f \n",femfft);
printf("Femur Male Estimate: %5.1f \n",femmft);
printf("Humerus Female Estimate: %5.1f \n",humfft);
printf("Humerus Male Estimate: %5.1f \n",hummft);
printf("\nHeight Estimates in Inches \n");
printf("Femur Female Estimate: %5.1f \n",femf2);
printf("Femur Male Estimate: %5.1f \n",femm2);
printf("Humerus Female Estimate: %5.1f \n",humf2);
printf("Humerus Male Estimate: %5.1f \n",humm2);
printf("\nHeight Estimates in Feet \n");
printf("Femur Female Estimate: %5.1f \n",femfft2);
printf("Femur Male Estimate: %5.1f \n",femmft2);
printf("Humerus Female Estimate: %5.1f \n",humfft2);
printf("Humerus Male Estimate: %5.1f \n",hummft2);
/* Exit program. */
return 0;}
5 Cm to Cm
/* This program will estimate height of person */
/* based on femur and humerus length */
#include <stdio.h>
#include <math.h>
int main(void)
{
/* Declare variables. */
double femur, femur_ht_f, femur_ht_m, humerus, humerus_ht_f,humerus_ht_m, femf,humf,femm,humm;
/* Get user input from the keyboard. */
printf("Enter Values in Centimeter. \n");
printf("Enter femur length: \n");
scanf("%lf",&femur);
printf("Enter humerus length: \n");
scanf("%lf",&humerus);
/* Compute height estimates. */
femur_ht_f = (femur/2.54)*1.94 + 28.7;
femur_ht_m = (femur/2.54)*1.88 + 32;
humerus_ht_f = (humerus/2.54)*2.8 + 28.2;
humerus_ht_m = (humerus/2.54)*2.9 + 27.9;
femf=(femur_ht_f*2.54);
femm=(femur_ht_m*2.54);
humf=(humerus_ht_f*2.54);
humm=(humerus_ht_m*2.54);
/* Print height estimates. */
printf("\nHeight Estimates in Centimeters \n");
printf("Femur Female Estimate: %5.1f \n",femf);
printf("Femur Male Estimate: %5.1f \n",femm);
printf("Humerus Female Estimate: %5.1f \n",humf);
printf("Humerus Male Estimate: %5.1f \n",humm);
/* Exit program. */
return 0;}
Comments
Post a Comment