Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  a.c
Language: C/C++
Code:
#include <stdio.h>
#include <string.h>
void main()
char str1[25],str2[25];
int x,y,r,n,counter1,counter2,points=0;
clrscr();
printf("nEnter a name:");
gets(str1);
printf("nEnter another name:");
gets(str2);
counter1= strlen(str1);
counter2=strlen(str2);
for(x=0;x<counter1;x++)
{
for(y=0;y<counter2;y++)
{
if(str1[x]==str3[y])
points++;
else;
}
if(points!=0)
points++;
}
for(n=1;n<counter2;n++)
{
if(str1[0]==str2[n])
points++;
else;
}
printf("n%d",points);
r=points%6;
switch (r)
{
case 1:
printf("nFriends");
break;
case 2:
printf("nLovers");
break;
case 3:
printf("nAdmire");
break;
case 4:
printf("nMarried");
break;
case 5:
printf("nEnemy");
case 6:
printf("nSweet");
break;
}
getch();
}
          
          
          
          
Comments: