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 difference between array and structure in c?
I completed my B.tech (IT). Actually I want to develop virtual object that which will change software technology in the future. To develop virtual object what course I have to take. can I any professor to help me.
Which programming language is best for getting job 2020?
In which header file is the null macro defined?
What are the advantages of using macro in c language?
What is the use of function overloading in C?
7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.
What is the purpose of 'register' keyword in c language?
c program to compute AREA under integral
Explain the difference between structs and unions in c?
Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10
List some basic data types in c?
write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3
Which type of language is c?
Who developed c language and when?