Showing posts with label absent. Show all posts
Showing posts with label absent. Show all posts

Tuesday, September 23, 2014

Program to print out the letters present in one word and absent in the other.

If you have any doubts, please do ask.

#include<stdio.h>
main()
{
    int i,j,flag=0;
char name1[10],name2[10];
scanf("%s",name1);
scanf("%s",name2);
for(i=0;i<strlen(name2);i++)
{
for(j=0;j<strlen(name1);j++)
{
if(name2[i]==name1[j])
flag=1;
}
if(flag==0)
{printf("%c",name2[i]);

}
else
    flag=0;
}}