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
Explain modulus operator.
What is equivalent to ++i+++j?
Can you assign a different address to an array tag?
What is a program flowchart and explain how does it help in writing a program?
Should I learn data structures in c or python?
How are structure passing and returning implemented?
What is this infamous null pointer, anyway?
What does main () mean in c?
5 Write an Algorithm to find the maximum and minimum items in a set of ānā element.
What are header files why are they important?
What is a macro in c preprocessor?
What are identifiers c?
what are the 10 different models of writing an addition program in C language?
How do you convert strings to numbers in C?
What is wrong with this program statement?