Write a C Program to compare two strings



Sumit Kar, Sorting, C, Timus Rak, C Program



#include <stdio.h>
#include <string.h>

int main()
{
char a[100], b[100];

printf("Enter the first string\n");
gets(a);

printf("Enter the second string\n");
gets(b);

if( strcmp(a,b) == 0 )
printf("Entered strings are equal.\n");
else
printf("Entered strings are not equal.\n");

return 0;
}

/*
Summary: Compares two string for equality
*/


Comments

Popular posts from this blog

Write a Program to Add two 3x3 Matrix using C

C program for Unit Conversion

Write a Program to Add two 5x5 Matrix using C