
54 Input and Output in C++
Explanation: In this program, the first statement displays “INDIA” followed by one blank space.
This is because the argument value is greater by one than the actual string length.
Similarly, the second statement displays “IS” followed by one blank space. The reason is same.
The last statement displays “GREAT.” Here, the argument value and the string lengths are
same. Hence, no blank spaces are displayed.
In case the argument value is less than the actual string length, the complete string will not be dis-
played. The number of characters of the string displayed depends on the value of the given argument.
cout.write (“GREAT”,5); ...