Web development
Class : BCA/ BSC 2nd year
Subject: Web development using php and MySQL
Subject type: vocational
Compiled by: Asst. Prof. Vibha barod
Technical Terms in Matrix Addition
1️⃣ Matrix
A matrix is a rectangular arrangement of elements (numbers) in rows and columns.
2️⃣ Order of Matrix
The order of a matrix is written as
m = number of rows
n = number of columns
👉 Matrix addition is possible only when matrices have the same order.
💻 Program
<!DOCTYPE html>
<html>
<body>
<form method="post">
<input type="number" name="a00" required>
<input type="number" name="a01" required><br><br>
<input type="number" name="a10" required>
<input type="number" name="a11" required><br><br>
<input type="number" name="b00" required>
<input type="number" name="b01" required><br><br>
<input type="number" name="b10" required>
<input type="number" name="b11" required><br><br>
<input type="submit" name="submit" value="Add">
</form>
<?php
if (isset($_POST['submit'])) {
$A = [
[$_POST['a00'], $_POST['a01']],
[$_POST['a10'], $_POST['a11']]
];
$B = [
[$_POST['b00'], $_POST['b01']],
[$_POST['b10'], $_POST['b11']]
];
echo "<h3>Result</h3>";
for ($i = 0; $i < 2; $i++) {
for ($j = 0; $j < 2; $j++) {
echo ($A[$i][$j] + $B[$i][$j]) . " ";
}
echo "<br>";
}
}
?>
</body>
</html>
The Department of Computer Science is dedicated to building strong technical foundations, logical thinking, and problem-solving skills among students. The department offers structured learning in core areas such as programming, data management, software applications, and emerging digital technologies. With a focus on both theoretical concepts and practical exposure, students are encouraged to develop computational skills relevant to academics, careers, and higher studies. This Study Material Portal has been designed to provide Computer Science students with organized access to syllabus-based notes, practical manuals, coding resources, assignments, and reference materials, supporting effective and self-paced learning.
0 comments:
Post a Comment