
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Addition of 2 matrices in Java
#include <stdio.h> int main() { int m, n, c, d, first[10][10], second[10][10], sum[10][10]; printf("Enter the number of rows and columns of matrix\n"); scanf("%d%d", &m, &n); printf("Enter the elements of first matrix\n"); for (c = 0; c < m; c++) for (d = 0; d < n; d++) scanf("%d", &first[c][d]); printf("Enter the elements of second matrix\n"); for (c = 0; c < m; c++) for (d = 0 ; d < n; d++) scanf("%d", &second[c][d]); printf("Sum of entered matrices:-\n"); for (c = 0; c < m; c++) { for (d = 0 ; d < n; d++) { sum[c][d] = first[c][d] + second[c][d]; printf("%d\t", sum[c][d]); } printf("\n"); } return 0; }
- Related Questions & Answers
- C++ program to overload addition operator to add two matrices
- Multiplication of two Matrices using Java
- Addition and Concatenation in Java
- C program for Addition and Multiplication by 2 using Bitwise Operations.
- Addition of tuples in Python
- Java program to add two matrices.
- Java program to subtract two matrices.
- Java program to multiply two matrices.
- Python program addition of two matrix
- Sum of the series 2^0 + 2^1 + 2^2 +...+ 2^n in C++
- Range Addition in C++
- Sum of series 1^2 + 3^2 + 5^2 + . . . + (2*n - 1)^2 in C++
- C Program for subtraction of matrices
- Addition of multi-byte numbers in Z-80
- Bitwise recursive addition of two integers in C
Advertisements