Question: Answer this in C This program read two strings and then calls and prints the result of the foo function, which has the following signature:
Answer this in C
This program read two strings and then calls and prints the result of the foo function, which has the following signature:
int foo(char str1[], char str2[]);
This function will count the number of characters that are lowercase at the start of both strings.

given code :
#include
int foo(char str1[], char str2[]);
int main() {
char str1[25]; char str2[25]; printf("Enter two strings: "); scanf("%s %s", str1, str2); printf("Both strings start with %d lowercase letters ", foo(str1, str2));
return 0; }
// DO NOT MODIFY ABOVE THIS LINE
int foo(char str1[], char str2[]) { /* Your code here */ }
Examples Enter two strings: roll tiDE Both strings start with 2 lowercase letters Explanation: Even though "roll" starts with 3 lowercase, "tiDE" only starts with 2, so both strings together only start with 2 lowercase letters. Enter two strings: COMPUTER science Both strings start with 0 lowercase letters Enter two strings: gme gamestop Both strings start with 3 lowercase letters Enter two strings: diamond hands Both strings start with 5 lowercase letters Enter two strings: rocket mooN!!1! Both strings start with 3 lowercase letters
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
