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

Assignment Help:

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");

                }

 

 

}

 

 


Related Discussions:- C program to reverse the elements of array

Amie, what happens when the following command is used? chmod u=rwx,go=r-x f...

what happens when the following command is used? chmod u=rwx,go=r-x foo

Type cast operator, What is  T y pe C a s t Op er a t o r :...

What is  T y pe C a s t Op er a t o r :   T h e f l o a t c a n b e c o n v e r t e d t o i n t e g e r v a l u

Write a program to add co-ordinates of the plane, Write a program to add co...

Write a program to add co-ordinates of the plane The class having x and y co-ordinates. Create three objects. Use a constructor to pass one pair of co-ordinates and a funct

Accessibility, What are the legal requirements with which websites must com...

What are the legal requirements with which websites must comply in order to meet the needs of persons with disabilities? Why is maximizing accessibility important to everyone?

Difference between method overloading and method overriding, Overloading a ...

Overloading a method (or function) in C++ is the ability for functions of the similar name to be defined as long as these methods have dissimilar signatures (different set of param

Algorithm, algorithm to prepare mark sheet of a student by inputing name,br...

algorithm to prepare mark sheet of a student by inputing name,branchcode,semester,register no,5 marks of students and total mark of student

C++, Write a c++ program to find the sum of 0.123 ? 103 and 0.456 ? 102 and...

Write a c++ program to find the sum of 0.123 ? 103 and 0.456 ? 102 and write the result in three significant digits.

Write a program to calculate the average of ten numbers, Write a program to...

Write a program to calculate the average of ten numbers       #include stdio.h     /* Only this header is needed since only IO are used */     void main()     {          char

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd