#include <stdio.h>
#include <math.h>
#include <conio.h>

#define  MULTIPLIER 25      /* a  */
#define  MODULUS    32      /* m  */
#define  INCREMENT  5       /* c  */
#define  SEED       5       /* x0 */


main(void)  {
  int x;
  int i;

  clrscr();
  x=SEED;                                     /* SEED is the initial value */
  for(i=0; i < 2*MODULUS; i++)  {             /* x[n+1]= (a*x[n]+c) mod m  */
    x=fmod(MULTIPLIER*x+INCREMENT, MODULUS);  /* a, the multiplier         */
    printf(" %d",x);                          /* m, the modulus            */
  }                                           /* c, the increment          */
}
