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 bitwise shift operators in c programming?
What is the purpose of 'register' keyword?
Tell me what is the purpose of 'register' keyword in c language?
What is the correct code to have following output in c using nested for loop?
difference between object file and executable file
What are identifiers c?
What is huge pointer in c?
How can you read a directory in a C program?
What are register variables? What are the advantage of using register variables?
Why is c called a mid-level programming language?
List a few unconditional control statement in c.
What is the difference between text files and binary files?
What is bubble sort in c?
How pointer is different from array?
What does return 1 means in c?