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 c preprocessors?

670


Why is structure important for a child?

599


What is a double c?

580


Do you know null pointer?

597


How to get string length of given string in c?

599






Write a code on reverse string and its complexity.

595


Why is c so popular?

640


What is a constant?

626


What is the correct declaration of main?

668


What is the newline escape sequence?

576


difference between Low, Middle, High Level languages in c ?

1624


Differentiate between functions getch() and getche().

614


How will you delete a node in DLL?

675


What is conio h in c?

614


How can you call a function, given its name as a string?

707