InidBIX.com
Arithmetic Aptitude Data Interpretation
Logical Reasoning Verbal Reasoning
Sudoku Number puzzles Missing letters puzzles Logical puzzles Playing cards puzzles Clock puzzles
C Programming Java Programming
Data Structures Operating Systems Networking DATABASE Database Basics SQL Server Basics SQL Server Advanced SQL Server 2008 JAVA Core Java Java Basics Advanced Java UNIX Unix File Management Unix Memory Management Unix Process Managemnt
Aptitude Test Verbal Ability Test Verbal Reasoning Test Logical Reasoning Test C Programming Test Java Programming Test
Group Disucssion HR Interview Questions Technical Interview Questions Body Language

Exercise

"Loneliness is the most terrible poverty."
- Mother Teresa

C Programming - Floating Point Issues

@ : Home > C Programming > Floating Point Issues > General Questions
1. 

Which statement will you add in the following program to work it correctly?

#include<stdio.h>
int main()
{
    printf("%f\n", log(36.0));
    return 0;
}

A. #include<conio.h>B.
#include<math.h>
C. #include<stdlib.h>D. #include<dos.h>

2. 

We want to round off x, a float, to an int value, The correct way to do is

A.
y = (int)(x + 0.5)
B. y = int(x + 0.5)
C. y = (int)x + 0.5D. y = (int)((int)x + 0.5)

3. 

Which of the following statement obtains the remainder on dividing 5.5 by 1.3 ?

A. rem = (5.5 % 1.3)B. rem = modf(5.5, 1.3)
C.
rem = fmod(5.5, 1.3)
D. Error: we can't divide

4. 

Which of the following range is a valid long double ?

A.
3.4E-4932 to 1.1E+4932
B. 3.4E-4932 to 3.4E+4932
C. 1.1E-4932 to 1.1E+4932D. 1.7E-4932 to 1.7E+4932

5. 

What are the different types of real data type in C ?

A. float, doubleB. short int, double, long int
C.
float, double, long double
D. double, long int, float



© 2008-2010 by IndiaBIX™ Technologies. All Rights Reserved | Copyright | Terms of Use & Privacy Policy