In molecular biology the "alphabet" of genes consists of four chemicals (called nucleotides) represented by the letters A C G T. A triad is a sequence of three nucleotides (for example AGA) and specifies an amino acid, a building block for proteins. A gene consists of a very, very long sequence of A-C-G-T combinations. Assume the input consists of a long sequence of A-C-G-T letters representing a gene. Write the code necessary to skip over the first 7 letters and then read the next 4 triads, printing each out on its own line.

Respuesta :

Answer:

#include<stdio.h>

void triad(char* genome){

char *k; k = genome + 7; //Skips first 7 nucleotides

int i = 0;

for (i=0;i<4;i++){

printf("%c%c%c\n",k[0],k[1],k[2]);

k+=3;

}

}

int main(){

char str[80] = "agcttacagctattagctagcttagagacc"; //Sample input string. Change this string for diff inputs

triad(str);

return 0;

}

ACCESS MORE