English
Tamil Nadu Board of Secondary EducationHSC Science Class 12

Identify in the following program. let rec gcd a b:= if b <> 0 then gcd b (a mod b) else return a The statement which terminates the recursion? - Computer Science

Advertisements
Advertisements

Question

Identify in the following program.

let rec gcd a b:=
      if b <> 0 then gcd b (a mod b) else return a

The statement which terminates the recursion?

One Line Answer

Solution

return a (when b becomes 0).

shaalaa.com
Introduction to Function
  Is there an error in this question or solution?
Chapter 1: Function - Evaluation [Page 10]

APPEARS IN

Samacheer Kalvi Computer Science [English] Class 12 TN Board
Chapter 1 Function
Evaluation | Q 2. v) | Page 10
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×