Home » C++ Programming » Basic Input/Output » Question
  1. What is the output of this program?
    #include <iostream>
    using namespace std;
    int main ()
    {
    char str[] = "Bjarne Stroustrup";
    int val = 66;
    char ch = 'B';
    cout.width (5);
    cout << right;
    cout << val << endl;
    return 0;
    }
    1. 66
    2. B
    3. Bjarne Stroustrup
    4. Compilation Error
    5. None of these
Correct Option: A

In this program, We are printing the five spaces and then we are printing the value of 65.



Your comments will be displayed only after manual approval.