Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

8. Know how to do these, to trace functions like these and to debug functions li

ID: 3654938 • Letter: 8

Question

8. Know how to do these, to trace functions like these and to debug functions like these: // recursive power , compute xn int exp(int x, int n){ if(n==_______) return _________; return ____________*exp(_________); } void main(){ int a,b; cin >>a>>b; cout<<endl<<exp(a,b)<<endl; } // recursive print of a string void print(char* s){ if(*s==____________) return; cout<<*s; print(______________); } void main(){ char a[6]="hello"; print(a); } // recursive reverse print of a string void rev_print(char* s){ if(*s==____________) return; ____________________________; ___________________________; } void main(){ char a[100]; cin>>a; rev_print(a); } // recursive reverse print of an integer void rev_print(int n){ if(n/10==0){ cout<<n; return; } cout<<__________________________; rev_print(___________________); } void main(){ int a; cin>>a; rev_print(a); } // recursive print of an integer void print(int n){ if(n/10==0){ cout<<n; return; } print(_______________); cout<<___________________; } void main(){ int a; cin>>a; print(a); }

Explanation / Answer

void rev_print(char* s){ if(*s=='') return; rev_print(s+1); cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote