plz check this program and correct the error...im getting around 3 errors. #incl
ID: 3633562 • Letter: P
Question
plz check this program and correct the error...im getting around 3 errors.
#include<stdio.h>
#include<string.h>
int compare(char *,char *);
void main()
{
char string1[20],string2[20];
char p,q;
int l1,l2;
printf(" enter the string1");
gets(string1);
printf(" Enter the string2");
gets(string2);
l1=strlen(string1);
l2=strlen(string2);
if(l1==l2)
compare(&p,&q);
else
printf(" Strings not equal");
}
int compare(char *p,char *q)
{
while(*p!='')
{
if(*p==*q)
{
p++;
q++;
}
printf(" strings equal")
else
break;}
return 0;
}