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

If 2 = 1.414, and the square_root() function returns -1.414, does it violate the following specification? -- square_root (x) -- inputs: x is a real number , x ≥ 0 -- outputs: y is a real number - Computer Science

Advertisements
Advertisements

प्रश्न

If `sqrt2` = 1.414, and the square_root() function returns -1.414, does it violate the following specification?

-- square_root (x)
-- inputs: x is a real number , x ≥ 0
-- outputs: y is a real number such that y2 = x

एक पंक्ति में उत्तर

उत्तर

No, because (- 1.414)2 = 2, which satisfies input – output relation (y2 = x)

shaalaa.com
Algorithmic Problems
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 6: Specification and Abstraction - Evaluation - Section - B [पृष्ठ ८६]

APPEARS IN

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

Englishहिंदीमराठी


      Forgot password?
Use app×