You are here:

C/need for a solution

Advertisement


Question
respected sir
i have question,which i sbelong to c,question is
what is the source code of this latin square
1 2 3 4
2 3 4 1
3 4 1 2
4 1 2 3

Answer
Hi Anirban

Try this out
int i,j,k;
for(i=0;i<4;++) {
 for(j=0;j<4;j++) {
   printf("%d",(((i+j)%4)+1));
}
printf("\n");
}

I have not compiled and tested the code. Please forgive me for any mistakes.

regards
joydeep Bhattacharya
http://www.scodz.com

C

All Answers


Answers by Expert:


Ask Experts

Volunteer


Joydeep Bhattacharya

Expertise

Ability to solve C and Data Structure problems and puzzles with simple and easy to understand logic.

Experience

C, C++, Java, Data Structure, PHP, Web Designing

Organizations
http://www.scodz.com Designation: webmaster

Publications
http://www.scodz.com

Education/Credentials
Master of Computer Applications

Past/Present Clients
http://analysingc.50webs.com http://www.funforu.com

©2012 About.com, a part of The New York Times Company. All rights reserved.