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...

what is the output of the following program?
#include<stdio.h>
void main()
{
float x=1.1;
while(x==1.1)
{
printf("\n%f",x);
x=x-0.1;
}
}

Answer Posted / battini.laxman

No output.Loop will not execute atleast once. because
compiler will treat real constant as double. So real
constants will not store exactly equal to that constant
value but appproximately equal to that constan in binary
format. So float value and doule value storing
approximately equal but not exactly.small difference will
be there.so condition will fail at first time.So loop will
not execute atleast once.

Is This Answer Correct ?    17 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain modulus operator.

1065


What is equivalent to ++i+++j?

1103


Can you assign a different address to an array tag?

1181


What is a program flowchart and explain how does it help in writing a program?

1323


Should I learn data structures in c or python?

1036


How are structure passing and returning implemented?

1053


What is this infamous null pointer, anyway?

1070


What does main () mean in c?

1110


5 Write an Algorithm to find the maximum and minimum items in a set of ā€˜n’ element.

2124


What are header files why are they important?

1104


What is a macro in c preprocessor?

1109


What are identifiers c?

1099


what are the 10 different models of writing an addition program in C language?

1904


How do you convert strings to numbers in C?

1238


What is wrong with this program statement?

1049