Question

3. Write a program to move data among variables: (1) define 4 int variable pos1, pos2, pos3, pos4, input 4 integer numbers from console and assign them to these variables;

display message in the following format: "pos1=a-number; pos2=a-number; pos3=a-number; pos4=a-number". “a-number" is replaced with real number. (2) Left shift data in these variables: for each variable to get the value of the successive variable, with pos4 getting pos1's value. Display pos1, pos2, pos3,and pos4 (3) Right shift data in these variables: for each variable to get the value of the previous variable, with pos1 getting pos4's value. Display pos1, pos2, pos3, and

Fig: 1

Fig: 2

Fig: 3

Fig: 4