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
Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

You are setting up an information system for a DVD Rental Company called Box office. The new system need to hold information about customers and DVDs rentals, payments and fines. C



#questio#A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2 where + denotes string concate

Pure Virtual Functions An abstract class is one, which is used just for deriving some other classes. No object of this class is declared and used in the program. Likewise, ther

#include #include #include #include #include class Employee { private: char *Name; //Set them as pointers... int IdNumber; char *Department; char *Position; public: voi

Write a program that predicts users age: Write a program that predicts users' age (0-128 years old) with at most 7 questions. The game starts with asking the user whether he/s

Develop a program to meet the following requirements: 1. Must use at least one function in addition to main (you can use more) 2. Must use selection 3. Must use deference/indire

Aim: To implement a program to swap two numbers using reference arguments. Code: void swap(int *a, int *b) {             int temp;             temp=*a;