When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?


No Answer is Posted For this Question
Be the First to Post Answer

Post New Answer

More C Interview Questions

What is a function simple definition?

0 Answers  


Explain what are header files and explain what are its uses in c programming?

0 Answers  


Explain how can I right-justify a string?

0 Answers  


write a progam to display the factors of a given number and disply how many prime numbers are there?

2 Answers  


how to generate the length of a string without using len funtion?

4 Answers  






Differentiate between the expression “++a” and “a++”?

0 Answers  


What is alloca() and why is its use discouraged?

1 Answers  


If I want to initialize the array like. int a[5] = {0}; then it gives me all element 0. but if i give int a[5] = {5}; then 5 0 0 0 0 is ans. what will I do for all element 5 5 5 5 5 in a single statement???

3 Answers   Amdocs, IBM,


#include<stdio.h> #include<conio.h> void main() { clrscr(); int a=0,b=0,c=0; printf("enter value of a,b"); scanf(" %d %d",a,b); c=a+b; printf("sum is %d",c); getch(); }

2 Answers  


write an algorithm to get a sentence and reverse it in the following format: input : I am here opuput: Here Am I note: first letter of every word is capiatlised

3 Answers  


What is the real time usage volatile?

2 Answers   Polycom,


List some of the static data structures in C?

0 Answers  


Categories