NPTEL » Problem Solving through Programming in C
Please scroll down for latest Programs. 👇
Week-06 Program-01
Due on 2025-09-04, 23:59 IST
Write a C Program to find Largest Element of an Integer Array. Here the number of elements in the array ‘n’ and the elements of the array is read from the test data.
Use the printf statement given below to print the largest element. printf("Largest element = %d", largest);
Use the printf statement given below to print the largest element. printf("Largest element = %d", largest);
Week-06 Program-02
Due on 2025-09-04, 23:59 IST
Write a C Program to print the array elements in reverse order (Not reverse sorted order. Just the last element will become first element, second last element will become second element and so on).
Here the size of the array, ‘n’ and the array elements is accepted from the test case data. The last part i.e. printing the array is also written. You have to complete the program so that it prints in the reverse order.
Here the size of the array, ‘n’ and the array elements is accepted from the test case data. The last part i.e. printing the array is also written. You have to complete the program so that it prints in the reverse order.
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1 | 5
1
2
3
4
5 | 5\n
4\n
3\n
2\n
1 | 5\n
4\n
3\n
2\n
1\n
| Passed after ignoring Presentation Error |
Test Case 2 | 4
45
65
35
25 | 25\n
35\n
65\n
45 | 25\n
35\n
65\n
45\n
| Passed after ignoring Presentation Error |
Week-06 Program-03
Due on 2025-09-04, 23:59 IST
Write a C program to read Two One Dimensional Arrays of same data type (integer type) and merge them into another One Dimensional Array of same type.
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1 | 3
10
20
30
4
40
50
60
70 | 10\n
20\n
30\n
40\n
50\n
60\n
70 | 10\n
20\n
30\n
40\n
50\n
60\n
70\n
| Passed after ignoring Presentation Error |
Test Case 2 | 4
9
7
6
5
2
30
50 | 9\n
7\n
6\n
5\n
30\n
50 | 9\n
7\n
6\n
5\n
30\n
50\n
| Passed after ignoring Presentation Error |
Week-06 Program-04
Due on 2025-09-04, 23:59 IST
Write a C Program to delete duplicate elements from an array of integers.
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1 | 5
50
60
30
20
30 | 50\n
60\n
30\n
20 | 50\n
60\n
30\n
20\n
| Passed after ignoring Presentation Error |
Test Case 2 | 6
40
20
50
30
20
10 | 40\n
20\n
50\n
30\n
10 | 40\n
20\n
50\n
30\n
10\n
| Passed after ignoring Presentation Error |