CPP

CPP

Numeric Limits has 9 Questions
To which type does the numeric limits are suitable?

Character types
Mixed type
Arithmetic types
None of the mentioned
Where does the member should be defined if it is used in the program?

Namespace scope
Character scope
Both a & b
None of the mentioned
What will the max function in the numeric limit will return for type float?

Maximum finite value for a float type
Maximum finite value
Minimum finite value
None of the mentioned
What is the output of this program?
  1.     #include 
  2.     #include 
  3.     using namespace std;
  4.     int main () 
  5.     {
  6.         cout << boolalpha;
  7.         cout << numeric_limits<int> :: has_infinity << '\n';
  8.         return 0;
  9.     }

53234
false
true
None of the mentioned
What is the output of this program?
  1.     #include  
  2.     #include 
  3.     using namespace std;
  4.     int main( )
  5.     {
  6.         cout << numeric_limits<float> :: digits10 << endl;
  7.         cout << numeric_limits<double> :: digits10 << endl;
  8.         float f = 99999999;
  9.         cout.precision ( 10 );
  10.         cout << f << endl;
  11.     }

6
15
100000000
All of the mentioned
What is the output of this program?
  1.     #include 
  2.     #include 
  3.     using namespace std;
  4.     int main( )
  5.     {
  6.         cout << numeric_limits<float> :: min_exponent << endl;
  7.     }

125
-125
123
None of the mentioned
Which header file is used for the numeric limits in C++?

<iostream>

<limits>

<number>

None of the mentioned
Pick out the incorrect static function member in numeric limits.

denorm_min
digits
infinity
max_finite
What is the output of this program?
  1.     #include 
  2.     #include 
  3.     using namespace std;
  4.     int main( )
  5.     {
  6.         cout << numeric_limits<float> :: is_exact;
  7.         cout << numeric_limits<double> :: is_exact;
  8.         cout << numeric_limits<long int> :: is_exact;
  9.         cout << numeric_limits<unsigned char> :: is_exact;
  10.     }

0010
0012
1100
0011