Thread: I need you help for matrix!!!

  1. #1
    Registered User
    Join Date
    Dec 2010
    Posts
    7

    I need you help for matrix!!!

    hello,

    I try to learn array in c and I face a question and I didn't find a solution this my question

    I want to make like this table:ImageShack® - Online Photo and Video Hosting

    I try to write syntax but I didn't finish,so I need your help

    syntax;
    Code:
    .....
    for (r=0;r<5;r++)//loop for rowwise
      
        for(c=0;c<5;c++)//loop for columnuise
    
         if(r==0&& c==0)
    
          A[r][c]=1;
    
          else 
    
          A[r][c]=0;
    ...
    (my English is not good,so I am sorry)

    thank you
    Last edited by redox; 12-19-2010 at 11:55 PM.

  2. #2
    -bleh-
    Join Date
    Aug 2010
    Location
    somewhere in this universe
    Posts
    463
    Quote Originally Posted by redox View Post
    hello,

    I try to learn array in c and I face a question and I didn't find a solution this my question

    I want to make like this table:ImageShack® - Online Photo and Video Hosting

    I try to write syntax but I didn't finish,so I need your help

    syntax;
    Code:
    .....
    for (r=0;r<5;r++)//loop for rowwise
      
        for(c=0;c<5;c++)//loop for columnuise
    
         if(r==0&& c==0)
    
          A[r][c]=1;
    
          else 
    
          A[r][c]=0;
    ...
    (my English is not good,so I am sorry)

    thank you
    change your if statement to:
    Code:
    if(r >= c)
    "All that we see or seem
    Is but a dream within a dream." - Poe

  3. #3
    Registered User
    Join Date
    Dec 2010
    Posts
    7
    Quote Originally Posted by nimitzhunter View Post
    change your if statement to:
    Code:
    if(r >= c)
    thaks for your advice

Popular pages Recent additions subscribe to a feed