in Programming in C
193 views
0 votes
0 votes
Predict the output of the following program. 
Void func (int n)
{
if (n > o)
{
func (n – 2);
Print f ("% d", n – 1);
Fun (n – 2);
}
}
if 10 is passed as literal value :
(1) 975921
(2) 951351
(3) 1315131713151317
(4) 131513713151319131513171315131

Your Answer:

3

Correct Answer: 4    Status: incorrect

in Programming in C
193 views

1 comment

option 4 is correct they missed printing 1 in options before 7.
0
0

1 Answer

1 vote
1 vote
Yes 4th option is correct, There has to be 9 in the middle as we have passed 10 initially so one recursion is for func(10-2) than printf(10-1) than same recusrion for func(10-2) hence option 4th.

Related questions