Powered By Blogger

Monday, May 4, 2009

C Programming

#include
#include
int compstr(char *str1,char *str2)
{
int y;
while(*str1!='\0'||*str2!='\0')
{
// putch(*str1);

if(*str1!=*str2)
{
y=-1;
break;
}
else
y=0;
*str1++;
*str2++;
}
return y;
}

void main()
{
clrscr();
char *str1,*str2;
int x;
printf("Enter first string:");
gets(str1);
printf("Enter second string:");
gets(str2);
x=compstr(str1,str2);
if(x==0)
printf("The two string are equal:");
else
printf("The two string are not equal:");
getch();
}

0 comments:

About This Blog

This is an important blog about updated news about computer science and technology.

Blog Archive

Visitors

  © Free Blogger Templates Blogger Theme II by Ourblogtemplates.com 2008

Back to TOP