मराठी
तामिळनाडू बोर्ड ऑफ सेकेंडरी एज्युकेशनएचएससी विज्ञान इयत्ता ११

Exchange the contents: Given two glasses marked A and B. Glass A is full of apple drink and glass B is full of grape drink. For exchanging the contents of glasses A and B, represent - Computer Science

Advertisements
Advertisements

प्रश्न

Exchange the contents: Given two glasses marked A and B. Glass A is full of apple drink and glass B is full of grape drink. For exchanging the contents of glasses A and B, represent the state by suitable variables, and write the specification of the algorithm.

टीपा लिहा

उत्तर

The specification of the algorithm:
exchange (A, B)
–inputs: A, B are real and >0
–outputs: A, B are real and >0
State representation
TEMP:=A
A:=B
B:= TEMP

shaalaa.com
Algorithm Design Techniques
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 6: Specification and Abstraction - Evaluation - Section - D [पृष्ठ ८७]

APPEARS IN

सामाचीर कलवी Computer Science [English] Class 11 TN Board
पाठ 6 Specification and Abstraction
Evaluation - Section - D | Q 3. | पृष्ठ ८७
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×