You are on page 1of 1

#include <stdio.

h>
int function(int x0,int a,int b,int m,int check[]){
int seq[m+1];
int i=0;
while(check[x0]!=1){
seq[i++] = x0;
check[x0]=1;
x0 = (a*x0 + b)%m;
}
m=i;
for ( i = 0; i < m; ++i)
{
printf("%d ",seq[i] );
} printf("\n");
}
int main(){
int a[]={6,3},b[]={0,0},m[]={11,11};
int i,j;
for ( i = 0; i < 2; ++i)
{
for (j = 1; j <11 ; ++j)
{
int array[11]={0};
function(j,a[i],b[i],m[i],
}
printf("\n");
}
}

array);

You might also like