Answer to Question #182029 in Programming & Computer Science for tala

Question #182029

What is the output of following function, if called as fun * (array, 0, 6) array content as follows: 1-2-3-4-5-6 ?


void fun(int array[], int index, int size) 

if(index >=size)

 return; 

cout<< array[index];

if(index+1< size) 

fun(array , index + 2 ,size);

cout << array[index];  


Select one:

a 132551 

b. 135531 

c.135135 

d. 146


1
Expert's answer
2021-04-19T03:54:35-0400
Step 1: index= 0, output= 1
Step 2: index= 2, output= 3
Step 3: index= 4, output= 5
Step 4: index= 4, output= 5
Step 5: index= 2, output= 3
Step 6: index= 0, output= 1

Answer: b. 135531

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS