Home » C++ Programming » Data Types » Question
  1. What will be output of this program?
    #include 
    using namespace std;
    int main()
    {
    int num = 5;
    int num0 = num / -10;
    int num1 = num % -10;
    cout << num0 << " "<< num1;
    return 0;
    }
    1. Compilation Error
    2. Runtime Error
    3. 0 5
    4. 5 0
    5. None of these
Correct Option: C

Sign of result of mod operation on negative numbers is sign of the dividend.



Your comments will be displayed only after manual approval.