Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

main()
{
float a=8.8;
double b=8.8;
if(a==b)
printf("Equal");
else
printf("not equal");
getch();
}
what is the output?
with reason

Answer Posted / vignesh1988i

here it will print : either NOT EQUAL or EQUAL
according to me and my compailer it's NOT EQUAL only.......
depends upon the compailer actually......

here variable 'a' is assigned wit float and 'b' is assigned
with double....
here comes the problem ie. of allocation of no. of bytes

according to my compailer float allocates 4 bytes and double
allocates 8 bytes.... so when it compares each location bit
by bit the float will lag by two bytes of space than double
has .. so since the comparsion takes a decision tat it's not
equal since it dosent check the other two locations of
double wit float which is lagging wit that two bytes of
memory space....... so it prints NOT EQUAL


thank you

Is This Answer Correct ?    19 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does it mean when the linker says that _end is undefined?

1061


what is the difference between north western polytechnique university and your applied colleges?? please give ur answers for this. :)

2364


Explain the process of converting a Tree into a Binary Tree.

2633


What is #include cctype?

1088


What are header files and explain what are its uses in c programming?

1089


What does %d do?

1228


HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????

2658


What is oops c?

1166


Give basis knowledge of web designing ...

1997


How variables are declared in c?

1011


What is a good way to implement complex numbers in c?

1023


Write the control statements in C language

1157


Write a program which returns the first non repetitive character in the string?

1079


What is a macro, and explain how do you use it?

1040


Explain what are the __date__ and __time__ preprocessor commands?

1092