Assume that number is an int variable that has already been initialized. Write a statement that prints out the value of number in a field of 10 positions (right-justified within that field).

Respuesta :

Answer:

cout<<ios::right <<setw(10)<<number<<endl;

Explanation:

  • Use the predefined function setw() to display the value of m in a print field of 10 positions.
  • seven spaces are occupied by the first 7 positions and 100 is occupied by next 3 positions.

Note: Make sure to add the iomanip header file for this to work.