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

What are bitwise shift operators in c programming?

838


What is the purpose of 'register' keyword?

890


Tell me what is the purpose of 'register' keyword in c language?

825


What is the correct code to have following output in c using nested for loop?

841


difference between object file and executable file

6342


What are identifiers c?

851


What is huge pointer in c?

769


How can you read a directory in a C program?

894


What are register variables? What are the advantage of using register variables?

906


Why is c called a mid-level programming language?

962


List a few unconditional control statement in c.

774


What is the difference between text files and binary files?

958


What is bubble sort in c?

834


How pointer is different from array?

841


What does return 1 means in c?

811