Free C Programs  : Download Free C Language Programs/Logics

C Programming Logics/ Programs

Note: These C programs are submitted by users. You can also contribute to our site by sending your c programs at our E mail ID. (don't send copyrighted material).


TO GENERATE THE LATIN SQUARE. */


#include"stdio.h"
#include"conio.h"

void main()
{
int i,j,k=1,n;
clrscr();
printf("\n Enter value of 'n' for Latin Square: ");
scanf("%d",&n);

for (i=1;i<=n;i++)
{
 printf("\n");
 for (j=1;j<=n;j++)
 {
  printf(" %d",k);
  if (k==n)
   k=1;
  else
   k++;
 }
  k++;
}
getch();
}