Your IP : 216.73.216.40


Current Path : /var/www/html/venkat/old/old/
Upload File :
Current File : /var/www/html/venkat/old/old/iit2015144_2.c

#include<stdio.h>
#include<string.h>
int main()
{
	char str1[20],str2[20];
	int m,n,i,j,max,min;
	char ch;
	printf("enter the 2 strings ");
	scanf("%s %s",str1,str2);
	m=strlen(str1);
	n=strlen(str2);
	if(m>n)
	{
		for(i=0;i<m;i++)
		{
			for(j=0;j<n;j++)
			{
				if(str1[i]==str2[j])
				{
					ch=str1[i];
					str1[i]=1;
					str2[j]=2;
					printf("%c",ch);
				}
			}
		}
	}	

	
	else
	{
		for(i=0;i<n;i++)
		{
			for(j=0;j<m;j++)
			{
				if(str1[j]==str2[i])
				{
					ch=str2[i];
					str1[j]=1;
					str2[i]=2;
					printf("%c",ch);
				}
			}
		}
	}
	printf("\n");
	return 0;
}