C program to reverse the elements of array, C/C++ Programming

C program to reverse the elements of array:

#define rows 3

#define cols 3

void main()

{

                int i=0,j=0;

                int arr[rows][cols];

                for (i=0; i<=rows-1; i++)

                                for(j=0;j<=cols-1;j++)

                                {

                                                printf("Enter elements (%d,%d)\n",(i+1),(j+1));

 

                                                scanf("%d",&arr[i][j]);

                                }

                for (i=0; i<=rows-1; i++)

                {

                                printf("\t");       

                                for(j=0;j<3;j++)

                                                {

                                                printf("%d  ",arr[i][j]);

                                                }

                                                printf("\n");

                }

                printf("\n Revers of matrix\n");

                for(i=rows-1;i>=0;i--)

                {

                                printf("\t");

                                for(j=0;j<=cols-1;j++)

                                {

                                                printf("%d  ",arr[i][j]);

                                                }

                                                printf("\n");

                }

 

 

}

 

 

Posted Date: 9/29/2012 7:20:46 AM | Location : United States







Related Discussions:- C program to reverse the elements of array, Assignment Help, Ask Question on C program to reverse the elements of array, Get Answer, Expert's Help, C program to reverse the elements of array Discussions

Write discussion on C program to reverse the elements of array
Your posts are moderated
Related Questions

Insert values in queue - C++ program: Write a program to insert values in queue. int main()   {         int k;     Queue timeLine;     cout     for(

You have to write a subroutine (assembly language code using NASM) for the following equation.

write a program to solve e^x



Prepare an Application in C# or C++ Project Description: We are seeking someone who can write a program in C# or C++. The idea is to prepare the program using a Cross Plat


Pawnbroker software to be written in VB Project Description: I want software written for my pawnshop. I am currently using a program called pawnboss but would like to have my

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