# Given the following function definition int factorial

• 8

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 2 - 4 out of 8 pages.

(5) Given the following function definitionintfactorial(intn) {if(n == 0)return0;elsereturnn * factorial(n - 1);}what is the output of the following code segment?printf("%d\n", factorial(4));A) 4B) 24C) 0D) 48E) None of the above
Exam 2 PracticeComputing IFall 2022(6) Given the following function definitionvoidgetChoice(int*choice,intcount) {if(count < 0)*choice = 0;if(count = 0)*choice = -1;else*choice = 99}what is the value of choice after the following code segment?intchoice, count = 3;getChoice(&choice, count);
November 15, 2022(7) Given the following function definitionvoidswapStrings(char*str1,char*str2) {chartemp = *str1;*str1 = *str2;*str2 = temp;}what is the value of choice after the following code segment?charsong[] ="song";charlocks[] ="locks";swapStrings(song, locks);printf("%s %s\n", song, locks);

Course Hero member to access this document

Course Hero member to access this document

End of preview. Want to read all 8 pages?

Course Hero member to access this document

Term
Spring
Professor
Dr.lin
Tags
Return statement, Void type, include, 2 pts, getChoice