Introducing Radical.sh

Forget Code launches a powerful code generator for building API's

String Comparison Without String Function in C

#include<stdio.h>
#include<conio.h>

void main()
{
char a[20],b[20];
int i,j,k=0;
printf("enter the first string:");
scanf("%s",a);
printf("enter the second string:");
scanf("%s",b);
for(i=0,j=0;a[i]!=NULL||b[j]!=NULL;i++,j++)
{
if(a[i]!=b[j])
k++;
}
if(k==0)
printf("string equals");
else 
printf("not equal");
}