C++ Programming
FLOATING POINT TYPES MCQs
Total Questions : 10
The char has lesser bytes than int and int has lesser bytes than double whereas int and float
can potentially have same sizes.
0.5f results in 0.5 to be stored in floating point representations.
Output:
$ g++ float.cpp
$ a.out
equal
None.
The value 123 is printed because of its precision.
$ g++ float.cpp
$ a.out
123
The double had to truncate the approximation due to it’s limited memory, which resulted in a number
that is not exactly 0.1.
Output:
$ g++ float2.out
$ a.out
0.10000000000000001
To make a floating point literal, we should attach a suffix of ‘f’ or ‘F’ and there should not be any
blank space.
None.
Float store floating point numbers with 8 place accuracy and requires 4 bytes of Memory. Double
has 16 place accuracy having size of 8 bytes.
Output:
$ g++ float3.cpp
$ a.out
harvard
Floating point types occur in only three sizes-float, long double and double.
Float for single precision, double for double precision and long double for extended precision.
Recent Questions
Q. The Enzymes That Catalyze The Reactions Of The Krebs Cycle A....
Q. IC Counters Are
Q. Synonym Of PROMULGATE
Q. ______bridge Measures The Unknown Inductance By Comparing It....
Q. An Imaginary Number Is One That Exists Only In The Mind Of T....
Q. The Following System Is Not Generally Used
Q. Exposure To Chemicals Having Carcinogenic Properties Cause
Q. Determine Output: Void Main() { Int I=0, J=1, K=2, M; M = I+....
Q. Sulfanilamide Was Synthesized By Which Of The Following Rese....
Q. The Personnel Which Deal With The Computer And Its Managemen....
Q. What Is The Detention Time Considered For The Contact Zone W....
Q. A, B Can Do A Piece Of Work In 30 Days , While B Can C Do Th....
Q. Identify The Exact Answer For The Blank (2)?
Q. Thermosetting Polymers As Compared To Thermoplastic Polymers....
Q. Where Did Last World Cup Soccer Tournament Took Place (2010)....
Q. Recently, The Lancet Medical Journal Has Published Its New R....
Q. what Is The Length Of A Square I Its Perimeter Is 160 Cm. ....
Q. Which Of These Methods Of Httpd Class Is Used To Read Data F....
Q. Coolant Present In The Primary Circuit Of A Pressurised Wate....
Q. What Is The Father Of A Calf Called?