|
From: Per W. <pw...@ia...> - 2005-10-31 01:17:56
|
You either just write x*x*x or you #include <math.h>
and then write pow(x,3).
/Per W
On Mon, 31 Oct 2005, Scott wrote:
> 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 =3D Weight*Speed;
> printf("\n Time is =A3%5.2f",total);
> }
>
> The formula is: hp =3D 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.
>
|