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
1. The main program must be in a file called A4.cpp 2. The data must be read in from a data file.  The user must enter the filename.  A sample data file will be provided on Mood

Write a program that allows user to enter number of elements in an array. The program then allows user to enter the elements. Write a function called max that returns the position

C program to count the words: void CountWords();          void main()          {             printf("\n\tcount the words and enter string\n\n\n");             Count

In rPeANUt implement the "char getchar()" and "void printstring(char *str)" functions. Using these functions implement the following: void main() {    while (1) {       ch

.Create a Csharp solution that will show a maze in the user interface and will show a mouse walking through the maze attempting to locate the exit door (the cheese).

You are to implement a code cracking system. The system will deploy four processes (p1,p2,p3 & p4) to try to guess the password of an encrypted code. For encryption, we consider th

An experiment succeeds twice as often as it fails. Find the chance that in the next six trials there will be at least four successes.

This task involves char arrays and pointer based string handling. Which we use to make a simple encryption program, using a Caesar Cipher, Write a program that: a. Asks

enter height of the shape: 1 3 5 3 1 3 5 7 5 3 5 7 9 7 5 3 5 7 5 3 1 3 5 3 1

Explain each of the algorithms in a way that would be understandable to an intelligent person who is not familiar with programming. You should not use any code (or even pseudo code