0% found this document useful (0 votes)
11 views7 pages

C Programming Assignments Overview

The document outlines four programming assignments for a C course at the Institute of Technology of Cambodia. The tasks include finding the second largest number in an array, performing operations on 2x2 matrices, deleting an element from an array, and creating a student management system. Each problem includes example inputs and expected outputs to guide students in their programming exercises.

Uploaded by

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

C Programming Assignments Overview

The document outlines four programming assignments for a C course at the Institute of Technology of Cambodia. The tasks include finding the second largest number in an array, performing operations on 2x2 matrices, deleting an element from an array, and creating a student management system. Each problem includes example inputs and expected outputs to guide students in their programming exercises.

Uploaded by

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

I2-AMS.

B Institute of Technology of Cambodia

Name: SOM Dara Date: 31/12/2024


ID: e20230267
Assignment 9
Problem1: Write a program in C to find the second largest number in an array.
Example:
INPUT:
Input the size of array : 5
Input 5 numbers in the array :
Enter number 1: 2
Enter number 2: 9
Enter number 3: 1
Enter number 4: 4
Enter number 5: 6
Output:
The Second largest element in the array is : 6

Data structure and Programming 1


I2-AMS.B Institute of Technology of Cambodia

Problem2: Write a C program to input 4 numbers and store in the two 2x2
matrices, say m1 and
m2. Each matrix is a 2D array of 2 rows and 2 columns. int m1[2][2],
m2[2][2];
a) Find the matrix m3 which is the summation of these two matrices. (m3 =
m1+m2)
b) Find and display the max and min numbers in m3.
Example:
INPUT:
Enter 4 numbers for matrix m1:
Data structure and Programming 1
I2-AMS.B Institute of Technology of Cambodia

2 3
3 4
Enter 4 numbers for matrix m2:
1 2
3
5
Output:
Sum of matrices (m3):
3 5
6 9
Maximum number in m3: 9
Minimum number in m3: 3

Data structure and Programming 1


I2-AMS.B Institute of Technology of Cambodia

Problem3: Write a program in C to delete an element at a desired position from


an array.
Example:
INPUT:
Input 5 elements in the array in ascending order:
element - 0 : 1
element - 1 : 2
element - 2 : 3
element - 3 : 4
element - 4 : 5
Input the position where to delete: 3
Output:
The new list is : 1 2 4 5

Data structure and Programming 1


I2-AMS.B Institute of Technology of Cambodia

Data structure and Programming 1


I2-AMS.B Institute of Technology of Cambodia

Problem4: Create a student management system program in C that allows users


to perform the following actions:
1. Add a new student
2. Delete a student by Id
3. Display all students
4. Exit
Hint: Each student has three attributes Id, name, gender

Data structure and Programming 1


I2-AMS.B Institute of Technology of Cambodia

Data structure and Programming 1

You might also like