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
What are c preprocessors?
Why is structure important for a child?
What is a double c?
Do you know null pointer?
How to get string length of given string in c?
Write a code on reverse string and its complexity.
Why is c so popular?
What is a constant?
What is the correct declaration of main?
What is the newline escape sequence?
difference between Low, Middle, High Level languages in c ?
Differentiate between functions getch() and getche().
How will you delete a node in DLL?
What is conio h in c?
How can you call a function, given its name as a string?