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
Write the control statements in C language
Tell me is null always defined as 0(zero)?
Explain what is the difference between the expression '++a' and 'a++'?
#include main() { enum _tag{ left=10, right, front=100, back}; printf("left is %d, right is %d, front is %d, back is %d",left,right,front,back); }
a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above
we need to calculating INCOME TAX for the person. The INCOME TAX is as follows:- First $10000/- of income : 4% tax Next $10000/- of income : 8% tax Next $10000/- of income : 11.5% tax above $10, 00,00/- : 15% tax What is the Solution of this Question ?
c language supports bitwise operations, why a) 'c' language is system oriented b) 'c' language is problem oriented c) 'c' language is middle level language d) all the above
When is a void pointer used?
Describe how arrays can be passed to a user defined function
What do you mean by invalid pointer arithmetic?
What does malloc () calloc () realloc () free () do?
What is the difference between declaring a variable by constant keyword and #define ing that variable?
What is a pragma?
write a C program:There is a mobile keypad with numbers 0-9 and alphabets on it. Take input 0f 7 keys and then form a word from the alphabets present on the keys.
What is 1d array in c?