mercredi 25 mars 2020

WHy can't my float variable store numbers after the decimal point?

#include <stdio.h>
main()
{
    int c=2,n=5;
    float percent;
    percent=(c/n)*100;
    printf("%.3f\n",percent);
}

what's wrong in this code please..?

Aucun commentaire:

Enregistrer un commentaire