Question: Simple recursion. Find the values of A, B, C, and D (lines 39, 41, 42, and 43). #include #include 3 #include 5 typedef struct 6

Simple recursion. Find the values of A, B, C, and D (lines 39, 41, 42, and 43).

Simple recursion. Find the values of A, B, C, and D (lines

#include #include 3 #include 5 typedef struct 6 7int cnt1; 8 int cnt2; 9 int cnt3; 10Counters 12 int func (int n, Counters count) 13 14 (count -cnt 1) ; 15 if (n 0) 16 17 18 19 count cnt2) ; 20int i; 21int sum0 22 for (i = 1; i (z n; i ++) 23 24 25 26 27 28 29 h 30 31 int main(int argc, char argv ) 32 1 33 Counters count -// initialize attributes to zero 34 35 36 37 38 int result= func (4, & count); 39 printf( "result %d ", result); // A return 0 (count -> cnt3)i; func (n i, count) sum 1 return sum; { . cnt1 = 0, cnt2 0, 40 printf ("Counters %d , 41 42 43 44 return EXIT SUCCESS 45 %d , %d ", count. Cnt 1, // count.cnt2, II C count.cnt3) / D

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!