Ask Question
23 September, 10:28

Write a statement that reads 5 successive integers into these variables that have already been declared : x1 x2x3x4 x5. Then write a statement that prints each out on its own line so that they form a right-justified column with a 5-digit width. If any of the integers are 5-digits in size, then they will start at the very beginning of their lines. For example:|54213| 8713| 23| 147| 15cin >> x1 >> x2 >> x3 >> x4 >> x5; cout << setw (5) << right << x1 << "/n"; cout << setw (5) << right << x2 << "/n"; cout << setw (5) << right << x3 << "/n"; cout << setw (5) << right << x4 << "/n"; cout << setw (5) << right << x5 << "/n";

+1
Answers (1)
  1. 23 September, 10:43
    0
    The statement to this question can be given as:

    Statement:

    cin >> x1 >> x2 >> x3 >> x4 >> x5;

    cout<
    cout << setw (5) << x1 << "/n" << setw (5) << x2 << "/n" << setw (5) << x3 << "/n" << setw (5) << x4 << "/n" << setw (5) << x5 << "/n";

    Explanation:

    In the question, it is given that there is 5 integer variable that is x1, x2, x3, x4, and x5. In the above statement, we print the value of the integer variable and the right-justified column with a 5-digit width. In this statement first, we insert the value of the variables then we print the value in 5-digit width within its own line.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write a statement that reads 5 successive integers into these variables that have already been declared : x1 x2x3x4 x5. Then write a ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers