menu
Qamnty
Login
Register
My account
Edit my Profile
Private messages
My favorites
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 th…
Ask a Question
Questions
Unanswered
Tags
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 th…
asked
Nov 27, 2019
48.3k
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
7.5k
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
7.7k
points
ask related question
comment
share this
0 Comments
Please
log in
or
register
to add a comment.
← Prev Question
Next Question →
Related questions
asked
Feb 8, 2024
178k
views
Ensure the source code file named Payroll.cpp is open in the code editor. Variables have been declared and initialized for you as needed, and the input and output statements have been written. Read the
Erosb
asked
Feb 8, 2024
by
Erosb
8.0k
points
Computers & Tech
college
1
answer
0
votes
178k
views
asked
Jan 14, 2024
231k
views
there are two string variables, s1 and s2, that have already been declared and initialized. write some code that exchanges their values.
Narduk
asked
Jan 14, 2024
by
Narduk
7.8k
points
Computers & Tech
high-school
1
answer
3
votes
231k
views
asked
Dec 22, 2024
26.7k
views
Write a statement to assign to kilos the value of pounds divided by 2.2. (The variables have already been declared and pounds has already been initialized .)
Ramanujan
asked
Dec 22, 2024
by
Ramanujan
8.1k
points
Computers & Tech
high-school
1
answer
5
votes
26.7k
views
Ask a Question
Welcome to Qamnty — a place to ask, share, and grow together. Join our community and get real answers from real people.
Categories
All categories
Mathematics
(3.7m)
History
(955k)
English
(903k)
Biology
(716k)
Chemistry
(440k)
Physics
(405k)
Social Studies
(564k)
Advanced Placement
(27.5k)
SAT
(19.1k)
Geography
(146k)
Health
(283k)
Arts
(107k)
Business
(468k)
Computers & Tech
(195k)
French
(33.9k)
German
(4.9k)
Spanish
(174k)
Medicine
(125k)
Law
(53.4k)
Engineering
(74.2k)
Other Questions
How do you can you solve this problem 37 + y = 87; y =
What is .725 as a fraction
How do you estimate of 4 5/8 X 1/3
Twitter
WhatsApp
Facebook
Reddit
LinkedIn
Email
Link Copied!
Copy
Search Qamnty