1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Array

Discussion in 'C' started by meyup, Feb 20, 2010.

  1. meyup

    meyup New Member

    Joined:
    Feb 15, 2010
    Messages:
    102
    Likes Received:
    0
    Trophy Points:
    0
    can anyone please explain the array?
    means how to take the input for a array and how to print a array?
    :)
     
  2. pankaj.sea

    pankaj.sea New Member

    Joined:
    Apr 6, 2009
    Messages:
    461
    Likes Received:
    13
    Trophy Points:
    0
    Occupation:
    Web Developer
    Location:
    Kolkata
    Home Page:
    hi!
    here is your answer!
    At first,
    say salary[10]
    So, it represents salary of 10 employee.

    Declaration:
    Data-type Name[size]
    Code:
    int matrix[2][2]
    this declares an two dimensional array. In this array we can take a 2x2 matrix's information!

    Reading Inputs
    Code:
    for(i=0;i<=9;i++)
      {
         for(j=0;j<=9;j++)
         {
         printf("Enter the velue for position matrix[%d][%d]:",i,j);
         scanf("%d",matrix[i][j]);
         }
      }
    you can print an array in the same way.
    I'll prefer you to see a book for more information!
    You can use thi book "Let Us C"
     
  3. meyup

    meyup New Member

    Joined:
    Feb 15, 2010
    Messages:
    102
    Likes Received:
    0
    Trophy Points:
    0
    thanks pankaj!
    :D
     

Share This Page