#include <stdio.h>
int main(void)
{
float x, y ,z,p;
x = 22;
y = 7;
p = 22/7;
z = x/y;
printf("%f\n",z); //output is 3.142857
printf("%f",p); //output is 3.000000
return 0;
}
`Why I had different output like this z = 3.142857 p = 3.000000
why all decimals are 0 in p and what is the different between this two methods and what is the correct method`