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 are the c keywords?

0 Answers  


Are local variables initialized to zero by default in c?

0 Answers  


If a five digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits.For example if the number that is input is 12391 then the output should be displayed as 23402

0 Answers  


how to reverse string "Hello World" by using pointers only. Without any temp var

1 Answers  


What are the average number of comparisons required to sort 3 elements?

2 Answers   DRDO,






what is the difference between procedure oriented and object oriented progaming language

1 Answers  


what are the files which are automatically opened when a c file is executed?

3 Answers  


1)what is the error in the following stmt where str is a char array and the stmt is supposed to traverse through the whole character string str? for(i=0;str[i];i++) a)There is no error. b)There shud be no ; after the stmt. c)The cond shud be str[i]!='\0' d)The cond shud be str[i]!=NULL e)i shud be initialized to 1

4 Answers  


marge linklist

0 Answers   HCL,


write a c program to find the roots of a quadratic equation ax2 + bx + c = 0

11 Answers   CSC, St Marys, TATA,


What is gets() function?

0 Answers  


Write a program to print factorial of given number without using recursion?

0 Answers  


Categories