Suppose you have strings char S1 rodent char S2 dog char S
Solution
c) z = strcmp (S1, S2) is 14
the first character that does not match has a greater value in s1 than in s2
here
char S1[ ] = {“rodent”};
char S2[ ] = {“dog”}; s1[0] is r and s2[0] is d
it return difference between r and d in trems of ascii
answer is 14
e)
Here is code:
int count = 0;
 char S5[ ] = {\"r?o?dsam?ple?nt\"};
 for(int i = 0; i<strlen(S5);i++)
 {
 if(S5[i] == \'?\')
 count++;
 }
Sample code to test:
#include <iostream>
 #include <string.h>
 using namespace std;
int main()
 {
 int count = 0;
 char S5[ ] = {\"r?o?dsam?ple?nt\"};
 // loops from 0 to length of S5
 for(int i = 0; i<strlen(S5);i++)
 {
 if(S5[i] == \'?\') // if it matches with ?
 count++;
 }
 cout <<\"The number of times ? occurs is \" << count << endl;
 
 return 0;
 }
Output:
The number of times ? occurs is 4
Rest of answer are correct
| >0 | the first character that does not match has a greater value in s1 than in s2 | 
![Suppose you have strings: char S1[] = {\  Suppose you have strings: char S1[] = {\](/WebImages/5/suppose-you-have-strings-char-s1-rodent-char-s2-dog-char-s-985252-1761506117-0.webp)
