menu
QAmmunity.org
Login
Register
My account
Edit my Profile
Private messages
My favorites
Register
Ask a Question
Questions
Unanswered
Tags
Categories
Ask a Question
Four integer variables, pos1, pos2, pos3, pos4, have been declared and initialized. write the code necessary to "left rotate" their values: for each variable to get the value of the successive variable,
asked
Nov 27, 2019
48.2k
views
4
votes
Four integer variables, pos1, pos2, pos3, pos4, have been declared and initialized. write the code necessary to "left rotate" their values: for each variable to get the value of the successive variable, with pos4 getting pos1's value.
Mathematics
high-school
Mdarwin
asked
by
Mdarwin
5.6k
points
answer
comment
share this
share
0 Comments
Please
log in
or
register
to add a comment.
Please
log in
or
register
to answer this question.
1
Answer
1
vote
The code goes like this
int temp;
temp = pos1; pos1 is assigned to temp.
pos1 = pos2; pos2 is assigned to pos1 and at this point temp is same as temp pos2 = pos3; pos3 is assigned to pos2 and at this point temp is same as temp pos3 = pos4; pos4 is assigned to pos3 and at this point pos4 is same as temp pos4 = temp; pos4 is temp now and cycle rotate making pos4 getting pos1 value.
Chevdor
answered
Dec 2, 2019
by
Chevdor
5.5k
points
ask related question
comment
share this
0 Comments
Please
log in
or
register
to add a comment.
Ask a Question
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.
6.2m
questions
8.2m
answers
Other Questions
Solve using square root or factoring method plz help!!!!.....must click on pic to see the whole problem
giles is searching for a sock and discovers that he has 10 socks for every 5 pairs of shoes. if he has 20 socks how many pair of shoes does he have
WILL UPVOTE EVERY ANSWER! MULTIPLE CHOICE! Solve for Y. 8-8y=2y+78 A)y=7 B)y=70 C)y=-7 D)y=-70
What is the solution? −10=2a−4 a=−7 a=−3 a = 3 a = 7
maggie has only dimes and quarters in her purse. she has 27 coins with a total value of 4.05. how many dimes does maggie have in her purse
Twitter
WhatsApp
Facebook
Reddit
LinkedIn
Email
Link Copied!
Copy
Search QAmmunity.org