Output of float divide by integer and multiply by integer

Check below program and guess what will be output.

float   a = 0.0;

float   b = 0.0;

int      c = 0;

a = (b/c) * 1000;

printf(” a = %f\n”);

  1. Will a be 0?
  2. Will a be float value like 0.000000?
  3. Will a have garbage value?

 

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.