[Dev-C++] Re: Dev-cpp-users digest, Vol 1 #2591 - 8 msgs
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Jarren L. <vb...@gm...> - 2005-10-31 17:14:44
|
Scott:
You could also just do this:
hp =3D3D weight * ((speed / 234)^3)
Using the ^ is the same as doing pow((speed/234),3);
Cheers,
Jarren
Okay another simple C question....
>
> I would like to make a quick HP calculator in C.
> (just mucking around with DevC)
> I would like to ask for user input, and then show the total...
>
> Something like:
>
> #include <stdio.h>
> main()
> {
> float Weight, Speed, Time;
> printf("Enter the weight : ");
> scanf("%f",&Weight);
> printf("Enter the Speed : ");
> scanf("%f",&Speed);
> Time =3D3D Weight*Speed;
> printf("\n Time is =3DA3%5.2f",total);
> }
>
> The formula is: hp =3D3D weight * (speed / 234)3
>
> How does one used cubed? is it something like 234*x*x ?
> Anyone shed some simple light...
>
> The example above is just something i imagine it will look like...
>
> Cheers,
> Scott.
>
|