Menu

(Solved) : Exercise 1 Shifting Array Elements Write Program Prompts User Input N Numbers Save Array P Q32942321 . . .

write c++ program !!!Exercise # 1: Shifting Array Elements Write a program that prompts the user to input N numbers and save them in an array. The program should do the following 1. Prt the numbers as in the sample Input/Output. 2. Pprompt the user to enter an integer value K N, the program will then shift the array elements K positions to the right, while the last K elements are moved to the beginning of the array For example: if we have an array [1 2 345678]. shifting 2 positions to the right should give the array [7 8 1 2345 6]. Sample Input/Output: Enter how many numbers: 8 Enter the 8 numbers: 13 45 77 92 -45 210 8 27 The 8 entered numbers are: [13 45 77 92 -45 21e 8 27] Enter the shifting value: 3 The numbers shifted to the right by 3 positions are: [210 8 27 13 45 77 92 -45]

Exercise # 1: Shifting Array Elements Write a program that prompts the user to input N numbers and save them in an array. The program should do the following 1. Prt the numbers as in the sample Input/Output. 2. Pprompt the user to enter an integer value K N, the program will then shift the array elements K positions to the right, while the last K elements are moved to the beginning of the array For example: if we have an array [1 2 345678]. shifting 2 positions to the right should give the array [7 8 1 2345 6]. Sample Input/Output: Enter how many numbers: 8 Enter the 8 numbers: 13 45 77 92 -45 210 8 27 The 8 entered numbers are: [13 45 77 92 -45 21e 8 27] Enter the shifting value: 3 The numbers shifted to the right by 3 positions are: [210 8 27 13 45 77 92 -45] Show transcribed image text

Expert Answer


Answer to Exercise 1 Shifting Array Elements Write Program Prompts User Input N Numbers Save Array P Q32942321 . . .

OR