Problem

What does this program do?1 // ex07_20.c2 // what does this program do?3 #include 4 #defin...

What does this program do?

1 // ex07_20.c

2 // what does this program do?

3 #include

4 #define SIZE 80

5

6 size_t mystery2(const char *s); // prototype

7

8 int main(void)

9 {

10 char string[SIZE]; // create char array

11

12 puts("Enter a string: ");

13 scanf("%79s", string);

14 printf("%d\n", mystery2(string));

15 }

16

17 // What does this function do?

18 size_t mystery2(const char *s)

19 {

20 size_t x;

21

22 // loop through string

23 for (x = 0; *s != '\0'; ++s) {

24 ++x;

25 }

26

27 return x;

28 }

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 7
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT