AA,AB,AC,AD,AE,AF,……………AT
BA,BB,BC,BD,BE,BF,…………..BT
CA,CB,CC,CD,CE,CF……………CT
#include<stdio.h>
#include<conio.h>
#include<string.h>
int main()
{
int count = 0;
char sequence1[30] = "ABCDEFGHIJKLMNOPQRST";
char sequence2[30] = " ABCDEFGHIJKLMNOPQRST ";
const char sequence3[30] = "AAAGACDF"; /*sequence taken from user which will be of length 31*/
printf(" %s %s \n ",sequence1,sequence2);
for (int i=0; i<strlen(sequence1); i++)
{
for(int j=0;j<strlen(sequence2);j++)
{
printf(" %c %c",sequence1[i],sequence2[j]);
for(int k=0; k < strlen(sequence3)-1; k++)
{
if(sequence3[k] == sequence1[i] && sequence3[k+1] == sequence2[j])
{
//cout<<"(equal)\t";
count++;
}
}
}
}
printf("the number of matches are found %d ",count);
getch();
}
This way we will get 400 combinations (Which program I have created successfully) but then user will put the value till 31 characters witch will be treated as 3rd string for E.g. “AAGACDF” now I have to check the frequency of user input in the sequence of 12,23,34,45,56,67,78,89 (2 CHAR SET) means AA,AA,AG,GA,AC,CD,DF and need to show the frequency
of user input
OUTPUT:
AA=2
AG=1
GA=1
AC=1
CD=1
DF=1
Edited by WingedPanther, 26 April 2010 - 03:37 PM.
add code tags (the # button)


Sign In
Create Account

Back to top









