C program to compare two Strings.

#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
	clrscr();
	char str1[100], str2[100];
	printf("Enter first string : ");
	gets(str1);
	printf("Enter second string : ");
	gets(str2);
	if(strcmp(str1, str2)==0)
	{
		printf("Both Strings Equal.");
	}
	else
	{
		printf("Both Strings not Equal.");
	}
	getch();
}
C program to compare two Strings. C program to compare two Strings. Reviewed by on December 25, 2019 Rating: 5

No comments:

Powered by Blogger.