In C Programming (Multiple Choice Question 1 ) Comparing Floating Point Value with Double

#include<stdio.h>
void main()
{
float num1 = 1.1;
double num2 = 1.1;
if(num1==num2)
    printf("Stanford");
else
    printf("New Delhi");
}


Options : 
  1. Stanford
  2. New Delhi
  3. Compile Error
  4. Run Time Error



Why & How ?
  • Float store floating point numbers with 8 place accuracy
    and requires 4 bytes of Memory.
  • Double has 16 place accuracy having size of 8 bytes
  • For floating point numbers (float, double, long double) the values cannot be predicted exactly.
Bookmark & Share

0 comments

Post a Comment

Your Feedback :This is Growing Site and Your Feedback is important for Us to improve the Site performance & Quality of Content.Feel Free to contact and Please Provide Name & Contact Email

Followers