IndiaBIX.com
Arithmetic Aptitude Data Interpretation
Logical Reasoning Verbal Reasoning Non Verbal Reasoning
General Knowledge
Sudoku Number puzzles Missing letters puzzles Logical puzzles Playing cards puzzles Clock puzzles
C Programming C++ Programming C# Programming Java Programming
Microbiology Biochemistry Biotechnology Biochemical Engineering
Civil Engineering Mechanical Engineering Chemical Engineering Networking Database Questions Computer Science Basic Electronics Digital Electronics Electronic Devices Circuit Simulation Electrical Enigneering Engineering Mechanics Technical Drawing
Placement Papers Group Disucssion HR Interview Technical Interview Body Language
Aptitude Test Verbal Ability Test Verbal Reasoning Test Logical Reasoning Test C Programming Test Java Programming Test Data Interpretation Test General Knowledge Test
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 C Interview Questions The C Language Basics .NET Interview Questions .NET Framework ADO.NET ASP.NET Software Testing

C Programming - Floating Point Issues

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

Exercise

"Nothing in life is to be feared, it is only to be understood."
- Marie Curie
6. 

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)

7. 

The binary equivalent of 5.375 is

A. 101.101110111B. 101.011
C. 101011D. None of above

8. 

A float occupies 4 bytes. If the hexadecimal equivalent of these 4 bytes are A, B, C and D, then when this float is stored in memory in which of the following order do these bytes gets stored?

A. ABCD
B. DCBA
C. 0xABCD
D. Depends on big endian or little endian architecture

9. 

What will you do to treat the constant 3.14 as a float?

A. use float(3.14f)B. use 3.14f
C. use f(3.14)D. use (f)(3.14)

10. 

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




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

Contact us: info@indiabix.com     Follow us on twitter!