serie10_cor - Srie 10 corrig 27 Novembre 2008 Exercice 1...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
27 Novembre 2008 Exercice 1 #include <stdio.h> #include <string.h> #include <stdlib.h> #include <stdbool.h> bool adn_valide(char sequence[512]) { int i=0; bool valid=true; while (i!=strlen(sequence) && (valid == true)) { if (sequence[i] != 'A' && sequence[i] != 'G' && sequence[i] != 'T' && sequence[i] != 'C') valid=false; else i++;} return valid; } bool compare(char *seq1, char *seq2) { int i=0; bool valid=true; if (strlen(seq1) != strlen(seq2)) return false; while (i!=strlen(seq1) && (valid == true)) { if (seq1[i] != seq2[i]) valid=false; else i++;} return valid; } void adn_to_arn(char *adn) { int i=0; for (i=0; i<strlen(adn); i++) if (adn[i] == 'T') adn[i] = 'U'; } char *complementaire(char *seq_originale) { char *comp; int i; comp = (char *)malloc (strlen(seq_originale) * sizeof (char)) ; for (i=0; i<strlen(seq_originale); i++) { switch (seq_originale[i]) { case 'C': comp[i] = 'G'; break;
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/08/2010 for the course CH 3123 taught by Professor -- during the Fall '08 term at Ecole Polytechnique Fédérale de Lausanne.

Page1 / 4

serie10_cor - Srie 10 corrig 27 Novembre 2008 Exercice 1...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online