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 / vignesh1988i
for the first time the loop will be true and it will print as 1.100000 , after reading the next line x will be 1.0, so again when it comes into while loop 1.000000 not equal to 1.100000 so it will come outside the loop
| Is This Answer Correct ? | 4 Yes | 20 No |
Post New Answer View All Answers
I just typed in this program, and it is acting strangely. Can you see anything wrong with it?
What is the scope of global variable in c?
How can I determine whether a machines byte order is big-endian or little-endian?
write a program to rearrange the array such way that all even elements should come first and next come odd
How do you define a function?
Explain the difference between malloc() and calloc() function?
What the different types of arrays in c?
What is pointers in c?
write an algorithm to display a square matrix.
What is the right type to use for boolean values in c? Is there a standard type? Should I use #defines or enums for the true and false values?
Explain what is a 'locale'?
How many bytes are occupied by near, far and huge pointers (dos)?
Can a pointer be volatile in c?
Is c high or low level?
Are the outer parentheses in return statements really optional?