I would write a complement() function.
Use switch-case syntax could help here
1 2 3 4 5 6 7 8 9 10 11 12 13 14
char DNA_complement(char base)
{
switch (base) {
case'A':
return'T';
case'G':
return'C';
case'T':
return'A';
case'C':
return'G';
}
// might also want to handle some error if it's not A,G,T, or C.
}
And then you would call complement() inside a for loop that goes through each character.