हिंदी
तमिलनाडु बोर्ड ऑफ सेकेंडरी एज्युकेशनएचएससी विज्ञान कक्षा ११

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×