i want c program for below description

Discussion in 'C' started by smit_it, Jun 25, 2010.

  1. smit_it

    smit_it New Member

    Joined:
    Jun 25, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    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
     
  2. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,009
    Likes Received:
    203
    Trophy Points:
    63
    Occupation:
    Senior Support Engineer
    Location:
    England
    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?
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice