• recategorized by
1,225 views
0 0 votes

What will be the return value of the below function, if it is called a sample(4)? 

int sample(int x){

    if( x == 0 || x ==2) return 1;

    return (sample(--x) * (x--));

}

 

Please log in or register to answer this question.

Position:
Show:

Related questions

0 0 votes
2 2 answers
802
802 views
0 0 votes
3 3 answers
2.6k
2.6k views
Aibi asked Oct 30, 2017
2,607 views
Consider the following program segmentint main(){char *str = "GATECS";printf("%d", madeeasy(str));return 0;}int madeeasy(int *p1){int *p2 = p1;while(*++p1);return p1-p2;}...
0 0 votes
0 0 answers
462
462 views
0 0 votes
1 1 answer
2.4k
2.4k views
VS asked Dec 14, 2017
2,391 views