What does this program do, assuming that the user enters two strings of the same length?
1 // ex07_26.c
2 // What does this program do?
3 #include
4 #define SIZE 80
5
6 int mystery3(const char "s1, const char *s2); // prototype
7
8 int main(void)
9 {
10 char string1[SIZE]; // create char array
11 char string2[SIZE]; // create char array
12
13 puts("Enter two strings: ");
14 scanf("%79s%79s", string1 , string2);
15 printf("The result is %d\n", mystery3(string1, string2));
16 }
17
18 int mystery3(const char *s1, const char *s2)
19 {
20 int result = 1;
21
22 for (; *s1 != '\0' && *s2 != '\0'; ++s1, ++s2) {
23 if (*s1 != *s2) {
24 result = 0;
25 }
26 }
27
28 return result;
29 }
Special Section: Building Your Own Computer
In the next several exercises, we take a temporary diversion away from the world of high-level language programming. We "peel open" a computer and look at its internal structure. We introduce machine-language programming and write several machine-language programs. To make this an especially valuable experience, we then build a computer (through the technique of software-based simulation) on which you can execute your machine-language programs!
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.