DATA STRUCTURE Syllabus

CHAPTER-1: INTRODUCTION

Write a C program for matrix multiplication.
WAP in C to add two matrices and display the result.
WAP in C to sort all elements in an array in ascending order.
WAP in C to delete an element from an array.
WAP in C to insert an element in the given position in an array.
WAP in C to search an element in an array and display its position.
```
#include <stdio.h>
int main()
{
int rows, columns;
printf("Enter the number of rows and columns of the matrices: ");
scanf("%d %d", &rows, &columns);
int matrix1[rows][columns], matrix2[rows][columns], sum[rows][columns];
printf("Enter the elements of first matrix:\n");
for (int i = 0; i < rows; i++)
{
for (int j = 0; j < columns; j++)
{
scanf("%d", &matrix1[i][j]);
}
}
printf("Enter the elements of second matrix:\n");
for (int i = 0; i < rows; i++)
{
for (int j = 0; j < columns; j++)
{
scanf("%d", &matrix2[i][j]);
}
}
// Adding matrices
for (int i = 0; i < rows; i++)
{
for (int j = 0; j < columns; j++)
{
sum[i][j] = matrix1[i][j] + matrix2[i][j];
}
}
// Printing the result
printf("The sum of the matrices is:\n");
for (int i = 0; i < rows; i++)
{
for (int j = 0; j < columns; j++)
{
printf("%d ", sum[i][j]);
}
printf("\n");
}
return 0;
}
```

Welcome to bitasoft, where learning is made fun and engaging! This platform provides a comprehensive and interactive learning experience, designed for fellows who keep a keen interest in technology and stuff. Provided with a wealth of resources, including lessons, notes, quizzes, and more. Whether you're a student looking to improve your grades, a parent seeking educational resources for your child, or a teacher searching for new teaching strategies, it is the perfect place to start. Explore now on this exciting journey of learning and discovery!

© 2022-2024 Bitasoft.in. All rights reserved.

Developed by RashhWorld