Question: Explain what this program docs. Also, explain how the mystery2() function works./* What does this program do? */#include int mystery2(const char *s);//prototype int main(void) {char

 Explain what this program docs. Also, explain how the mystery2() function

Explain what this program docs. Also, explain how the mystery2() function works./* What does this program do? */#include int mystery2(const char *s);//prototype int main(void) {char string[80];//create char array printf("Enter a string:"); scanf("%79s", string); printf("%d ", mystery2(string)); return 0;//indicate successful termination.//end main//What does this function do? int mystery2(const char *s) {int x;//counter//loop through string. for (x = 0; *s != '\0'; s++) {x++;}//end for return x;}//end function mystery2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!