Code:
if((strcmp(aminoacidos[i],"ttt"))||(strcmp(aminoacidos[i],"ttc")))
printf("F");
The above code says:
"If aminoacidos[i] is NOT equal to "ttt" OR aminoacidos[i] is NOT equal to "ttc"
then print F"
Obviously it MUST be not equal to one or the other (i.e., it can't be both at the same time), so the condition will ALWAYS be true.
Try this:
Code:
switch (resto)
{
case 0:
for(i=0;i<size;i++)//assembles the matrix
{
aminoacidos[x][y]=nucleotideos[i];
y++;
if (y==3)
{
y=0;
x++;
}
}
for(i=0;i<(size/3);i++)//translated matrix
{
if (strncmp(aminoacidos[i], "ttt", 3) == 0 ||
strncmp(aminoacidos[i], "ttc", 3) == 0)
{
printf("F");
}
else if (strncmp(aminoacidos[i], "tta", 3) == 0 ||
strncmp(aminoacidos[i], "ttg", 3) == 0 ||
strncmp(aminoacidos[i], "ctt", 3) == 0 ||
strncmp(aminoacidos[i], "cta", 3) == 0 ||
strncmp(aminoacidos[i], "ctc", 3) == 0 ||
strncmp(aminoacidos[i], "ctg", 3) == 0)
{
printf("L");
}
}
break;