Two dimension array- c program, C/C++ Programming

2-D Array- C program:

Define a two dimension array using c.

void convert ( int a[10][10] , int[] , int , int);

void main()

  {

  clrscr();

  int a[10][10], b[100], n, m, i, j;

  cout<<"enter the number of rows of the array : ";

  cin>>n;

  cout<<"enter the number of columns of the array : ";

  cin>>m;

  for (i=0;i

                {

                for(j=0;j

                                {

                                cout<<"enter element "<

                                cin>>a[i][j];

                                }

                }

  convert (a,b,n,m);

  cout<

  cout<<"the converted array is :"<

  for(i=0;i<(m*n);i++)

                {

                cout<

                }

  getch();

  }

  void convert (int a[10][10] , int b[100] , int n , int m)

                {

  int i,j,k=0;

  for(i=0;i

                {

                for(j=0;j

                                {

                                b[k]=a[i][j];

                                k++;

                                }

                }

  }

Posted Date: 10/19/2012 3:09:48 AM | Location : United States







Related Discussions:- Two dimension array- c program, Assignment Help, Ask Question on Two dimension array- c program, Get Answer, Expert's Help, Two dimension array- c program Discussions

Write discussion on Two dimension array- c program
Your posts are moderated
Related Questions
flow chart for prime or not

C Program for SWAPPING THE STRING #include conio.h> #include stdio.h> void main() {           char a[50],temp=0;           int i=0,c=0,c1=0,l=0;           clr

C Program for CREATE MATRICES #include stdio.h> #include conio.h> void main() {           int a[10][10],rw=0,clm=0,i=0,j=0;           char s=' ';           c

M em b e r d e r e f e r e n c i ng o p e r a t o r s: T h e s e op e r a t o r s w i l l b e d i s c u s s e d l a t

there is a pebble merchant. he sells the pebbles,that are used for shining the floor.his main duty is to take the length of the room side but he sometines mistakes doing that and m



Is there any difficulty with the following : char*a=NULL; char& p = *a;? A: The result is indeterminate. You must never do this. A reference has to always refer to some object.

Program is to reverse the names stored in an array pointer: Program is to reverse the 6 names stored in an array pointer as name[] void main()   {  clrscr();  char