Is it possible to output double/float number as an result of dividing of two integers? For example:
int a = 5
int b = 3
printf(" Dividing: %d / %d = %f",a ,b ,a/b);
Because in my program, it is showing error.
warning: format ‘%f’ expects argument of type ‘double’, but argument 2 has type ‘int’ [-Wformat=]
47 | printf("Percentage of odds: %f\n", (odd / random) * 100);
| ~^ ~~~~~~~~~~~~~~~~~~~~
| | |
| double int
| %d
try.c:48:23: warning: format ‘%f’ expects argument of type ‘double’, but argument 2 has type ‘int’ [-Wformat=]