0% found this document useful (0 votes)
5 views1 page

Java OOP Lab Programs: Matrix & Stack

Uploaded by

Chithrashree .D
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Java OOP Lab Programs: Matrix & Stack

Uploaded by

Chithrashree .D
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

OOPS WITH JAVA LAB PROGRAMS-100% WORKING( SMALLER PROGRAMS)

1. MATRIX ADDITION
2. package oops;
3.
4. import [Link].*;
5.
6. public class MatrixAddition {
7. public static void main(String[] args) {
8. int n = new Scanner([Link]).nextInt();
9. int[][] sum = new int[n][n];
10. for (int i = 0; i < n; i++, [Link]())
11. for (int j = 0; j < n; j++)
12. [Link]((sum[i][j] = 2 * (i + j)) + "\
t");
13. }
14. }

2. STACK CLASS TO HOLD A MAXIMUM OF 10


INTEGERS

You might also like