Program to illustrates, Initializing a Two-Dimensional Array


#include <iostream.h>
#include <conio.h>
   void main ()
    {
       int i , j ;
       int digits[4][3] = { {0,1,2},{3,4,5},{6,7,8},{9,10,11} } ;
       cout<<"\n The digits are :\n" ;
       for (i=0 ; i<4 ; i++)
       {
         for (j=0 ; j<3 ; j++)
              cout<<" \n "<<digits[i][j] ;
       }
        getch () ;
      }

0 comments:

Post a Comment

 
 
 
 


Copyright © 2012 http://codeprecisely.blogspot.com. All rights reserved |Term of Use and Policies|