hi, i am very confused about when and were to put float and int.
i know that float is for numbers with decimals (3.14...etc) but when i am writing code i get always confused.
This programm just does some easy calculations, when i give it x,y,z values.
it works with int's but i cant figure out what to change so that it also computes numbers like 1.5 etc..
Code:
int
sin1(int x)
{
int a;
a=pow(x,3);
return a;
}
int
sin2(int x,int y,int z)
{
int b;
b=(x*y*z);
return b;
}
sin1();
sin2();
int main()
{
int x,y,z,c;
scanf("%d%d%d",&x,&y,&z);
c=(sin1(x)+sin2(x,y,z));
printf("f(x)=(x^3)+(x*y*z)= %d",c);
}