Ask Question
1 September, 00:34

Write a code segment that displays the values of the integers x, y, and z on a single line, such that each value is right-justified with a field width of 6.

+2
Answers (1)
  1. 1 September, 03:31
    0
    x = int (input ("enter first number: "))

    y = int (input ("enter second number: "))

    z = int (input ("enter third number: "))

    print ('%6d %6d %6d' % (x, y, z))

    Explanation:

    Using python programming language we receive three integers variables (x, y, z) then using string formatting (%6) which specifies that the output should be right justified with a width of 6, the values are printed out.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write a code segment that displays the values of the integers x, y, and z on a single line, such that each value is right-justified with 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