c - This code of mine is showing floating point error.. can anyone please exlain -


#include<stdio.h> void main() {    float = 5, b = 2;    int c;    c = % b;    printf("%d", c); } 

i getting floating point error n program-me..
please explain this..

the operands of operator % have integral (i.e. int, byte, ...). have cast floats first:

c = ((int)a) % ((int) b); 

Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -