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.7k
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.3m
questions
8.4m
answers
Other Questions
What is the least common denominator of the four fractions 20 7/10 20 3/4 18 9/10 20 18/25
What is 0.12 expressed as a fraction in simplest form
Solve using square root or factoring method plz help!!!!.....must click on pic to see the whole problem
What is distributive property ?
What is the measure of xyz
Twitter
WhatsApp
Facebook
Reddit
LinkedIn
Email
Link Copied!
Copy
Search QAmmunity.org