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

void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }

1727


Define macros.

1281


Describe the steps to insert data into a singly linked list.

1077


.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }

1301


What is an expression?

1059


What does *p++ do? What does it point to?

1065


Synonymous with pointer array a) character array b) ragged array c) multiple array d) none

1074


What are the disadvantages of external storage class?

1062


Why is c called "mother" language?

1298


What are the application of void data type in c?

1191


Can you write the function prototype, definition and mention the other requirements.

1139


code for replace tabs with equivalent number of blanks

2167


Explain the difference between #include "..." And #include <...> In c?

1033


Do you know the purpose of 'register' keyword?

1023


What is #include called?

1064