Write code that performs the following input operations: • Read an int from the keyboard and assign it to a variable named k. (Do not print a prompt. Use the input() function without a prompt-string to read the input.) • Read a float from the keyboard and assign it to a variable named d. (Do not print a prompt. Use the input() function without a prompt- stringto read the input.) • Read a string from the keyboard and assign it to a variable named s. (Do not print a prompt. Use the input() function without a prompt-

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter7: Arrays
Section: Chapter Questions
Problem 7PP: (Numerical) Using the srand() and rand() C++ library functions, fill an array of 1000 floating-point...
icon
Related questions
Question
100%
Write code that performs the following input operations:
• Read an int from the keyboard and assign it to a variable named k. (Do
not print a prompt. Use the input() function without a prompt-string to
read the input.)
• Read a float from the keyboard and assign it to a variable named d.
(Do not print a prompt. Use the input() function without a prompt-
stringto read the input.)
• Read a string from the keyboard and assign it to a variable named s.
(Do not print a prompt. Use the input() function without a prompt-
string to read the input.)
After you have performed the input, on one line, print these variables in
reverse order (s followed by d, followed by k) with exactly one space in
between each. On a second line, print them in the original order (k followed by
d, followed by s) with one space in between them.
Transcribed Image Text:Write code that performs the following input operations: • Read an int from the keyboard and assign it to a variable named k. (Do not print a prompt. Use the input() function without a prompt-string to read the input.) • Read a float from the keyboard and assign it to a variable named d. (Do not print a prompt. Use the input() function without a prompt- stringto read the input.) • Read a string from the keyboard and assign it to a variable named s. (Do not print a prompt. Use the input() function without a prompt- string to read the input.) After you have performed the input, on one line, print these variables in reverse order (s followed by d, followed by k) with exactly one space in between each. On a second line, print them in the original order (k followed by d, followed by s) with one space in between them.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr