Ask Question
8 November, 23:58

Write a statement that reads 5 successive integers into these variables that have already been declared: x1, x2, x3, x4, 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:

+1
Answers (1)
  1. 9 November, 02:26
    0
    Following are the statement in C+ + language:

    #include / / header file

    using namespace std; / / namespace

    int main () / / main method

    {

    int x1, x2, x3, x4, x5; / / variable declaration

    cout<<" Enter the 5 sucessive integer:";

    cin>>x1>>x2>>x3>>x4>> x5; / / taking 5 input from user

    cout<
    / / prints each of its own line and form a right-justified

    cout<
    return (0);

    }

    Output:

    Enter the 5 sucessive integer: 45

    23

    445

    6

    8

    45

    23

    445

    6

    8

    Explanation:

    Description of program is given below

    Declared a 5 integer value x1, x2, x3, x4, x5 respectively. Read the 5 integer value from user by using cin funtion. Finally Print these 5 value in its own line and form a right-justified by using setw () function on it
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, x2, x3, x4, 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