ProAnswers.org

Write a C program to enter two strings. Indicate after what character the lengths of the two strings have no match.?

#include

#include 

#include 

void main() 

{ 

char stra[10], strb[10]; 

int length; 

clrscr(); 

Printf(“First string:”); 

gets(stra); 

printf(“second string:”); 

gets(strb); 

length=strspn(stra, strb); 

printf(“After %d characters there is no match

, length”);

getch(); 

} 

Output: 

First string: GOOD MORNING 

Second string: GOOD BYE 

After 5 characters there is no match