MY CART (5)

Use Coupon: CART20 and get 20% off on all online Study Material

ITEM
DETAILS
MRP
DISCOUNT
FINAL PRICE
Total Price: Rs.

There are no items in this cart.
Continue Shopping
Menu
Grade: 10
        

Write a program in C++ to display a matrix in ascending order

8 years ago

Answers : (1)

SAGAR SINGH - IIT DELHI
879 Points
							

Dear student,

#include  <iostream>

using namespace std;

#define  m  3

#define  n  3

 

int main()

{

     int  i, j;

     int  x[m][n]={{10,25,33}, {21,32,43},{20,42,51}};

     cout<<"\n3x3 arrays' subscripts and\n";

     cout<<"their respective elements\n";

     cout<<"--------------------------\n";

     // the outer for loop, reading the row by row...

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

            // the inner loop, for every row, read every column by column...

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

                  cout<<"["<<i<<"]"<<"["<<j<<"]"<<"="<<x[i][j]<<"\n";

     return 0;

}

 

8 years ago
Think You Can Provide A Better Answer ?
Answer & Earn Cool Goodies


Course Features

  • 728 Video Lectures
  • Revision Notes
  • Previous Year Papers
  • Mind Map
  • Study Planner
  • NCERT Solutions
  • Discussion Forum
  • Test paper with Video Solution


Course Features

  • 731 Video Lectures
  • Revision Notes
  • Test paper with Video Solution
  • Mind Map
  • Study Planner
  • NCERT Solutions
  • Discussion Forum
  • Previous Year Exam Questions


Ask Experts

Have any Question? Ask Experts

Post Question

 
 
Answer ‘n’ Earn
Attractive Gift
Vouchers
To Win!!! Click Here for details