Home » C++ Programming » Operators » Question
  1. What is the output of this program?
    #include 
    using namespace std;
    main()
    {
    double num = 23.9399;
    float num0 = 20.23;
    int p ,q;
    p = (int) num;
    q = (int) num0;
    cout << p <<' '<< q;
    return 0;
    }
    1. 20 23
    2. 23.9399
    3. 20.23
    4. 23 20
    5. None of these
Correct Option: D

In this program, we are casting the operator to integer, So it is printing as 23 and 20.



Your comments will be displayed only after manual approval.