I think something is wrong with my Flames project.. please help me
the wrong might have been the counting.. example
Rizal
maria
I crossed out the similar letter and it came out that it had only three letters that are not similar so in F L A M E S -- it should be "A" for affection but in my code it came out that it is seven and its in "F" for friends what might be the wrong?
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main() {
char str1[20];
char str2[20];
int x,y,z,flames,counter1,counter2,points=0;
clrscr();
printf ("enter your name here: ");
gets(str1);
printf ("Enter your crush's name:");
gets(str2);
counter1=strlen(str1);
counter2=strlen(str2);
for (x=0; x<counter1; x++){
for (y=0; y<counter2; y++){
if (str1[x]==str2[y])
points++;
else;
}
if(points!=0)
points++;
}
for (z=1; z<counter1; z++) {
if (str1[0]==str1[z])
points++;
else;
}
printf ("the points is %d \n",points);
flames=points%6;
switch(flames)
{
case 1: printf ("\n you're Friends"); break;
case 2: printf ("\n you're Lovers"); break;
case 3: printf ("\n you're Affection"); break;
case 4: printf ("\n you're Marriage"); break;
case 5: printf ("\n you're Enemies"); break;
case 0: printf ("\n you're sweethearts"); break;
}
getch();
}