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 is the significance of an algorithm to C programming?
What is fflush() function?
What are the properties of union in c?
Can a local variable be volatile in c?
what are enumerations in C
Explain the difference between ++u and u++?
What is the use of clrscr?
What is time complexity c?
What is a stream in c programming?
Where are the auto variables stored?
How are strings stored in c?
What is string concatenation in c?
What is c method?
How many types of operators are there in c?
What is sorting in c plus plus?