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 30 31 32 33 34 35 36 37 38 39 40
|
#include<stdio.h>
void input(float feet , float inches);
void calc(float &feet , float &inches);
void output(float &feet , float &inches);
int main()
{
int inches,feet,feet1, ans, inches1
{
char ans;
do
{
input(feet1,inches1);
calc(feet1,inches1);
printf("puteet1,inches1");
printf("Would you like to calculate again? y/n");
scanf(" %d",&ans );
}
while(ans == 'y'||ans == 'Y');
}
void input(float feet , float inches)
{
printf("Enter feet:\n");
scanf(" %d ",&feet);
printf("Enter inches:\n");
scanf(" %d",&inches);
}
void calc(float &feet , float &inches)
{
float meters , centimeters;
meters = feet*0.3048;
centimeters = inches * 2.54;
}
void output(float &feet , float &inches)
{
calc(feet,inches);
printf("Converted feet to metres %d :\n",metres);
printf("Converted inches to centimeters %d :\n",centimeters);
}
return 0
}
|