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
Why do we use namespace feature?
What is the advantage of a random access file?
What is the best way of making my program efficient?
PROGRAM TO WRITE CONTENTS OF 1 FILE IN REVERSE TO ANOTHER FILE,PROGRAM TO COPY 1 FILE TO ANOTHER BY SPECIFYING FILE NAMES AS COMMAND LINE
What are the two forms of #include directive?
GIVEN A FLOATING POINT NUMBER HOW IS IT ACTUALLY STORED IN MEMORY ? CAN ANYONE EXPLAIN?? THE 32 BIT REPRESENTATION OF A FLOATING POINT NUMBER ALLOTS: 1 BIT-SIGN 8 BITS-EXPONENT 23 BITS-MANTISSA
Write a program to find factorial of a number using recursive function.
What is the heap in c?
In which layer of the network datastructure format change is done
What is a program flowchart and how does it help in writing a program?
Explain the properties of union. What is the size of a union variable
Is javascript based on c?
In C programming, what command or code can be used to determine if a number of odd or even?
Sir i need notes for structure,functions,pointers in c language can you help me please
Write a C program in Fibonacci series.