hi! im also a beginner in using C im confused because ive got a problem. which the answer of C is different from mine here's my problem:
!our teacher ask us to covert yards to meters, inches, feet. (my problem is the meter)

feet = yard * 3
inches = yard * feet * 12
meter = yard * feet * inches * 2.54 / 100

lets say: 1 yard = 3 feet
1 yard = 36 inches
1 yard = 0.9144 meters <----------- (which is true!)

i don't understand C because the answer is 274.32 , derived form (1*3*12*2.54) /*in C*/
but in calculator the answer is 91.44 <----------- (which is true!)

please help me!

I'm newish aswell but try this

#include <stdio.h>

int main()
{	
	float input;

	printf("please enter how many Yards you wish to convert"\n");
	scanf("%f",&input);
	printf("%0.5f yards equals %0.5f inches, 0.5% feet and %0.5f meters",input,input*36,input*3,input*0.9144);
	system("pause");
}

it should convert it with 5 decimal places of accuracy

thanks :D to your formula now i got the exact answer and the program :D i love this forum :D

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.