When I run this code the output of D comes out as the value of C. Is it because I call for a float and it just takes the most recent float in the memory?
#include <stdio.h>
int main()
{
int a=3/2;
printf("The value of 3/2 is : %d\n", a );
float b=3.0/2;
printf("The value of 3/2 is : %f\n", b );
float c=7.0/2; <-------
printf("The value of 3/2 is : %f\n", c );
int d=3.0/2;
printf("The value of 3/2 is : %f\n", d ); <-------
return 0;
}
The value of 3/2 is : 1
The value of 3/2 is : 1.500000
The value of 3/2 is : 3.500000
The value of 3/2 is : 3.500000