English
Tamil Nadu Board of Secondary EducationHSC Science Class 12

Which of the following is a normal function definition and which is a recursive function definition. let rec sum num: if (num!=0) then return num + sum (num-1) else return num - Computer Science

Advertisements
Advertisements

Question

Which of the following is a normal function definition and which is a recursive function definition.

let rec sum num:
   if (num!=0) then return num + sum (num-1)
   else
   return num

One Line Answer

Solution

Recursive function

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

APPEARS IN

Samacheer Kalvi Computer Science [English] Class 12 TN Board
Chapter 1 Function
Evaluation | Q 5. iii) | Page 9
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×