1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
#include <stdio.h>
#include <math.h>
void input(int *, int *);
void calculation(int, int, int*, int*);
void output(int, int, int, int);
int main()
{
int feet, inches, meters, centimeters;
input(&feet, &inches);
calculation(feet, inches, &meters, ¢imeters);
output(feet, inches, meters, centimeters);
return 0;
}
void input(int *f, int *i)
{
printf("Enter feet:\n");
scanf("%d", f);
printf("Enter inches:\n");
scanf("%d", i);
}
void calculation(int f, int i, int *m, int *c)
{
*m = floor(i)
}
void output(int f, int i, int m, int c)
{
printf("%d feet and %d inches converted is %d meters and %d centimeters \n", f, i, m, c);
}
|