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

#define MAX(x,y) (x) >(y)?(x):(y) main() { inti=10,j=5,k=0; k= MAX(i++,++j); printf("%d..%d..%d",i,j,k); }

987


What do you mean by command line argument?

862


Who developed c language and when?

845


How can you invoke another program from within a C program?

844


Do you have any idea about the use of "auto" keyword?

891


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

878


How do you sort filenames in a directory?

972


what is the difference between 123 and 0123 in c?

970


Why is it important to memset a variable, immediately after allocating memory to it ?

1804


What is New modifiers?

901


Explain the difference between call by value and call by reference in c language?

894


can we have joblib in a proc ?

1972


What is wrong with this program statement?

818


Describe wild pointers in c?

870


List the different types of c tokens?

866