C Books Guide and List
C++ Books Guide and List
Best Java Books

3,749 questions

4,049 answers

114 comments

10,705 users

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

0 votes
104 views
asked Jan 7, 2014 by sara Guru (24,570 points)

1 Answer

0 votes

#include<stdio.h>

#include<conio.h>

#include<string.h>

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\n, length”);

getch();

}

Output:

First string: GOOD MORNING

Second string: GOOD BYE

After 5 characters there is no match 

answered Jan 7, 2014 by rajesh Guru (39,140 points)

Related questions

0 votes
1 answer 1,436 views
0 votes
2 answers 24 views
0 votes
1 answer 3,077 views
0 votes
1 answer 434 views
...