Saturday, November 21, 2015

Two Dimensional Array in C Using Initialized Values

A simple program that I wrote in C programming language that shows how to declare and display initialized values using two dimensional array and for loop statement.

If you  have some questions please send me an email at jake.r.pomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.


                                                            
                                                   Sample Program Output


Program Listing


#include <stdio.h>

main()
 {
     int a[3][2] = {  {1,2},
                      {3,4},
                      {5,6}
                    };
int row=0,col=0;
  for (row=0; row<3; row++) {
        for (col=0; col<2; col++) {
            printf(" %d ",a[row][col]);

        }

     }
 }

No comments:

Post a Comment