Sh3ll
OdayForums


Server : Apache
System : Linux profile 3.10.0-1160.88.1.el7.x86_64 #1 SMP Tue Mar 7 15:41:52 UTC 2023 x86_64
User : apache ( 48)
PHP Version : 8.0.28
Disable Function : NONE
Directory :  /var/www/html/venkat/old/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //var/www/html/venkat/old/lit2015044_5.c
#include<stdio.h>
#include<string.h>

//int common(char*,char*,char*,int,int);

int main()
{
 char str1[1000],str2[1000],str3[1000],j,k=0,i,l3;
 int l1,l2;
 
 printf("enter the first string\n");
 gets(str1);
 
 printf("enter another string\n");
 gets(str2);

 l1 = strlen(str1);
 l2 = strlen(str2);
 if(l1 >=l2)
 {
   for (j=0;j<l1;j++)
    {
     for(i=0;i<l2;i++)
      {
       if(str1[j] == str2[i])
       {
        str3[k] = str2[i];
        str2[i] = '-';
         k++;
       }
    }
  }
 }
 else
 {
  for(j=0;j<l2;j++)
  {
   for(i=0;i<l1;i++)
    {
     if(str2[j]==str1[i])
    {
     str3[k] = str1[i];
     str1[i] = '-';
      k++;
    }
  }
 }
 }  
  str3[k]='\0';
 i=0;
 while(str3[i]!='\0')
{
 printf("%c",str3[i]);
 i++;
}
 return 0;
}
 
 

ZeroDay Forums Mini