Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   i want c program for below description (http://www.go4expert.com/forums/i-c-program-description-t22543/)

smit_it 25Jun2010 20:10

i want c program for below description
 
hey i want output in c like below


1 2 3
8 9 4
7 6 5

for the input 3

same way for input 4

output is

1 2 3 4
12 13 14 5
11 16 15 6
10 9 8 7

xpi0t0s 29Jun2010 12:37

Re: i want c program for below description
 
Sorry, we don't do homework here. You'll have to go somewhere else.

If you want some help writing the code, that's different. What have you written so far and where are you stuck? Can you think of a way to determine what number to display next? Do you think you might need to store the numbers in some kind of data structure before displaying them, or can you calculate the next number without storage?


All times are GMT +5.5. The time now is 00:18.