#include<stdio.h>
struct anik
{
float in;
float ft;
};
int main()
{
struct anik d1, d2, d3;
printf("Enter Information for 1st distance : \n");
printf("Enter inch : ");
scanf("%f", &d1.in);
printf("Enter Feet : ");
scanf("%f", &d1.ft);
printf("\nEnter Information for 2nd distance : \n");
printf("Enter inch : ");
scanf("%f", &d2.in);
printf("Enter Feet : ");
scanf("%f", &d2.ft);
d3.in = d1.in + d2.in;
d3.ft = d1.ft + d2.ft;
while(d3.in > 12.0)
{
d3.in = d3.in - 12.0;
d3.ft++;
}
printf("\nSummation of Distance %0.1f Inch and %0.1f Feet\n", d3.in, d3.ft);
return 0;
}
struct anik
{
float in;
float ft;
};
int main()
{
struct anik d1, d2, d3;
printf("Enter Information for 1st distance : \n");
printf("Enter inch : ");
scanf("%f", &d1.in);
printf("Enter Feet : ");
scanf("%f", &d1.ft);
printf("\nEnter Information for 2nd distance : \n");
printf("Enter inch : ");
scanf("%f", &d2.in);
printf("Enter Feet : ");
scanf("%f", &d2.ft);
d3.in = d1.in + d2.in;
d3.ft = d1.ft + d2.ft;
while(d3.in > 12.0)
{
d3.in = d3.in - 12.0;
d3.ft++;
}
printf("\nSummation of Distance %0.1f Inch and %0.1f Feet\n", d3.in, d3.ft);
return 0;
}
Comments
Post a Comment