Question: C language Your task for this activity is to implement the following functions: e. checkGuess(): This function should take two strings as input. If the

C language

Your task for this activity is to implement the following functions:

e. checkGuess(): This function should take two strings as input. If the two strings are equivalent, return a 1 from the function. If theyre different, return a 0. There are at least two ways to do this: you may use the strcmp() function from , or you can iterate over every character in the strings. You may assume that the strings are equal length.

Given:

#include #include

// Function prototype should be placed below

int main(void){ //TODO: compare two strings char s1[10]; char s2[10]; printf("Enter the first string: "); scanf("%s", &s1); printf("Enter the second string: "); scanf("%s", &s2); int c = checkGuess(s1, s2); // output if they are matched or not

return 0; }

/* Complete the function */

checkGuess(){

}

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!