#include <stdio.h>
#include <stdlib.h>
float calculate(float s,int k,int j,int y);
main(){
float f;
float s=2;
int k,j,y = 2;
f = calculate(s,k,j,y);
printf("%f\n\n",f);
system("\npause");
return 0;
}
float calculate (float s,int k,int j,int y){
float f;
s=(float)k/(float)j;
f= s/(float)y;
return f;
}
f dovrebbe restituire 0.5
perchè k e j valgono 2
2/2=1
s=1
1/y=2 = 0.5
Ma printa qualcosa tipo 0.001456
Help me