Hello friends!!!!!
C Pgr to find whether the two strings are same (or) not
C LANGUAGE
10/3/20241 min read
#include <stdio.h>
#include<string.h>
int main() {
char s1[20] , s2[20] , *p;
printf("Enter a name : ");
gets(s1);
printf("Enter another name : ");
gets(s2);
p = strstr(s1,s2);
if(p) {
printf("Both the given names are same");
}
else {
printf("Both the entered names are not same");
}
}
Output :
Enter a name : Rishendra
Enter another name : Rishi
Both the entered names are not same
=== Code Execution Successful ===