Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
805 views
in Composition and Decomposition by (49.1k points)
closed by

Circulate the contents:

Write the specification and construct an algorithm to circulate the contents of the variables A, B and C as shown below: The arrows indicate that B gets the value of A, C gets the value of B and A gets the value of C.

1 Answer

+1 vote
by (54.8k points)
selected by
 
Best answer

Specifications:

1. circulate 

2. – – inputs: a, b, c: = A, B, C

3. – – outputs: a, b, c: = C, A, B

Algorithm:

1. circulate (a, b, c)

2. – – a, b, c: = A, B, C 

3. temp : = c

4. c : = b

5. b : = a

6. a : = temp

7. – – a, b, c: = C, A, B

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

...