E
ehabaziz2001
That program does not yield and respond correctly espcially for the
pointers (*f),(*i)
in
print_divide_meter_into(&meter,&yds,&ft,&ins);
/*--------------pnt02own.c------------
---1 inch = 2.51 cm
---1 inch = 2.54/100 Meter
---1 yard = 3 feet
---1 feet = 12 inch
---inches=meter/0.0254
---feets =meter/0.3048 (0.0254 * 12)
---yards =meter/0.9144 (0.0254 * 36)
---meter=1/0.0254=39.3700 INCH
---meter=1/0.3048=3.28084 FEET
---meter=1/0.9144=1.09361 YARDS
----------------------------------------------*/
#include "stdio.h"
/*Module 2 : using pointers in a function to convert Size Entry
in meter to sizes of Yards,feet,inches-----*/
main()
{
float meter;
float yds,ft,ins;
char another();
system("cls");
do {
input_meter(&meter);
divide_meter_into(&meter,&yds,&ft,&ins);
print_divide_meter_into(&meter,&yds,&ft,&ins);
} while (another()=='y');
return 0;
}
input_meter(float *m)
{
printf("\nEnter size in meter :");
scanf("%f",&(*m));
printf("\nYou have Entered % f",*m);
}
divide_meter_into(float *m,float *y,float *f,float *i)
{
float temp_m=0;
temp_m=(*m)*100.0/2.54;
(*y)=(temp_m)/36.0;
(temp_m)=(temp_m)-(*y)*36.0;
(*f)=(temp_m)/12.0;
(*i)=(temp_m)-(*f)*12.0;
printf("\n Meter %f is = %f yards %f feet %f
inches",(*m),(*y),(*f),(*i));
}
print_divide_meter_into(float *m,float *y,float *f,float *i)
{
printf("\n Meter %f is = %f yards %f feet %f
inches",(*m),(*y),(*f),(*i));
}
char another()
{
char answer;
printf("\n do ou want to procees (y/n)");
scanf("\n");
scanf("%c",&answer);
return (answer);
}
pointers (*f),(*i)
in
print_divide_meter_into(&meter,&yds,&ft,&ins);
/*--------------pnt02own.c------------
---1 inch = 2.51 cm
---1 inch = 2.54/100 Meter
---1 yard = 3 feet
---1 feet = 12 inch
---inches=meter/0.0254
---feets =meter/0.3048 (0.0254 * 12)
---yards =meter/0.9144 (0.0254 * 36)
---meter=1/0.0254=39.3700 INCH
---meter=1/0.3048=3.28084 FEET
---meter=1/0.9144=1.09361 YARDS
----------------------------------------------*/
#include "stdio.h"
/*Module 2 : using pointers in a function to convert Size Entry
in meter to sizes of Yards,feet,inches-----*/
main()
{
float meter;
float yds,ft,ins;
char another();
system("cls");
do {
input_meter(&meter);
divide_meter_into(&meter,&yds,&ft,&ins);
print_divide_meter_into(&meter,&yds,&ft,&ins);
} while (another()=='y');
return 0;
}
input_meter(float *m)
{
printf("\nEnter size in meter :");
scanf("%f",&(*m));
printf("\nYou have Entered % f",*m);
}
divide_meter_into(float *m,float *y,float *f,float *i)
{
float temp_m=0;
temp_m=(*m)*100.0/2.54;
(*y)=(temp_m)/36.0;
(temp_m)=(temp_m)-(*y)*36.0;
(*f)=(temp_m)/12.0;
(*i)=(temp_m)-(*f)*12.0;
printf("\n Meter %f is = %f yards %f feet %f
inches",(*m),(*y),(*f),(*i));
}
print_divide_meter_into(float *m,float *y,float *f,float *i)
{
printf("\n Meter %f is = %f yards %f feet %f
inches",(*m),(*y),(*f),(*i));
}
char another()
{
char answer;
printf("\n do ou want to procees (y/n)");
scanf("\n");
scanf("%c",&answer);
return (answer);
}