Home » C++ Programming » Operators » Question
  1. What is the output of this program?
    #include <iostream>
    using namespace std;
    int main()
    {
    double P = 12.93099;
    float Q = 11.120;
    int R ;
    R = (int) P;
    cout << R <<" ";
    R = (int) Q;
    cout << R ;
    return 0;
    }
    1. 12.93099 11.120
    2. 11.120 12.93099
    3. 11 12
    4. 12 11
    5. None of these
Correct Option: D

In this program, we casted the data type to integer.



Your comments will be displayed only after manual approval.