Page 88 - 6437
P. 88

}


                                /* output each array element's value */
                                for (j = 0; j < 10; j++ )
                                {

                                   printf("Element[%d] = %d\n", j, n[j] );
                                }


                                return 0;

                            }

                          When the above code is compiled and executed, it produces the following result:

                                          Elem
                                      ent[0]      00
                                          Elem
                                      ent[1]      01
                                          Elem
                                      ent[2]      02
                                          Elem
                                      ent[3]      03
                                          Elem
                                      ent[4]      04
                                          Elem
                                      ent[5]      05
                                          Elem
                                      ent[6]      06
                                          Elem
                                      ent[7]      07
                                          Elem
                                      ent[8]      08
                                          Elem
                                      ent[9]      09

                          Arrays in Detail
                          Arrays are important to C and should need a lot more attention. The following important
                   concepts related to array should be clear to a C programmer:


                         Concept                           Description


                         Multidimensional arrays           C supports multidimensional arrays. The simplest
                                                    form of the multidimensional array is the two-dimensional
                                                    array.


                                                                                                      91
   83   84   85   86   87   88   89   90   91   92   93