Write a program to print all the locations at which a particular element (taken as input) is found in a list and also print the total number of times it occurs in the list. The location starts from 1.
For example if there are 4 elements in the array
5
6
5
7
If the element to search is 5 then the output will be
5 is present at location 1
5 is present at location 3
5 is present 2 times in the array.
Public Test Cases
Input
Expected Output
Actual Output
Status
Test Case 1
4
5
6
5
7
5
5 is present at location 1.\n
5 is present at location 3.\n
5 is present 2 times in the array.
5 is present at location 1.\n
5 is present at location 3.\n
5 is present 2 times in the array.
Passed
Test Case 2
5
67
80
45
97
100
50
50 is not present in the array.
50 is not present in the array.
Passed
Week 9 : Programming Assignment 2
Due on 2023-09-28, 23:59 IST
Write a C program to search a given element from a 1D array and display the position at which it is found by using linear search function. The index location starts from 1.
Public Test Cases
Input
Expected Output
Actual Output
Status
Test Case 1
5
78
90
34
54
98
90
90 is present at location 2.
90 is present at location 2.
Passed
Test Case 2
6
30
40
50
20
90
60
90
90 is present at location 5.
90 is present at location 5.
Passed
Week 9 : Programming Assignment 3
Due on 2023-09-28, 23:59 IST
Write a C program to search a given number from a sorted 1D array and display the position at which it is found using binary search algorithm. The index location starts from 1.
Public Test Cases
Input
Expected Output
Actual Output
Status
Test Case 1
5
10
20
30
40
50
40
40 found at location 4.
40 found at location 4.
Passed
Test Case 2
4
44
55
66
77
10
Not found! 10 isn't present in the list.
Not found! 10 isn't present in the list.
Passed
Week 9 : Programming Assignment 4
Due on 2023-09-28, 23:59 IST
Write a C program to reverse an array by swapping the elements and without using any new array.
Public Test Cases
Input
Expected Output
Actual Output
Status
Test Case 1
4
10
20
30
40
Reversed array elements are:\n
40\n
30\n
20\n
10
Reversed array elements are:\n
40\n
30\n
20\n
10\n
Passed after ignoring Presentation Error
Test Case 2
5
50
60
40
30
20
Reversed array elements are:\n
20\n
30\n
40\n
60\n
50
Reversed array elements are:\n
20\n
30\n
40\n
60\n
50\n
Passed after ignoring Presentation Error
Week 10 : Programming Assignment 01
Due on 2023-10-05, 23:59 IST
Public Test Cases
Input
Expected Output
Actual Output
Status
Test Case 1
0.001
Root = 1.7197
Root = 1.7197
Passed
Test Case 2
0.1
Root = 1.6875
Root = 1.6875
Passed
Week 10 : Programming Assignment 02
Due on 2023-10-05, 23:59 IST
Write a C code to check if a 3 x 3 matrix is invertible. A matrix is not invertible if its determinant is 0.
Public Test Cases
Input
Expected Output
Actual Output
Status
Test Case 1
1
2
3
4
5
6
7
8
9
The given matrix is not invertible
The given matrix is not invertible
Passed
Test Case 2
1
0
5
2
1
6
3
4
0
The given matrix is invertible
The given matrix is invertible
Passed
Week 10 : Programming Assignment 03
Due on 2023-10-05, 23:59 IST
Write a C program to sort a given 1D array using pointer in ascending order.
Public Test Cases
Input
Expected Output
Actual Output
Status
Test Case 1
5
20
40
50
30
10
10\n
20\n
30\n
40\n
50
10\n
20\n
30\n
40\n
50\n
Passed after ignoring Presentation Error
Week 10 : Programming Assignment 04
Due on 2023-10-05, 23:59 IST
Write a C program to sort a 1D array using pointer by applying Bubble sort technique.
Public Test Cases
Input
Expected Output
Actual Output
Status
Test Case 1
6
-10
90
30
20
-100
50
-100\n
-10\n
20\n
30\n
50\n
90
-100\n
-10\n
20\n
30\n
50\n
90\n
Passed after ignoring Presentation Error
Week 11 : Programming Assignment 1
Due on 2023-10-12, 23:59 IST
Public Test Cases
Input
Expected Output
Actual Output
Status
Test Case 1
25
The respective value of the variable v is: 56.42
The respective value of the variable v is: 56.42
Passed
Test Case 2
16
The respective value of the variable v is: 28.74
The respective value of the variable v is: 28.74
Passed
Week 11 : Programming Assignment 2
Due on 2023-10-12, 23:59 IST
Public Test Cases
Input
Expected Output
Actual Output
Status
Test Case 1
0
1
The integral is: 0.335000
The integral is: 0.335000
Passed
Test Case 2
1
3
The integral is: 8.680000
The integral is: 8.680000
Passed
Week 11 : Programming Assignment 3
Due on 2023-10-12, 23:59 IST
Public Test Cases
Input
Expected Output
Actual Output
Status
Test Case 1
0.9
y=1.777165
y=1.777165
Passed
Test Case 2
1.2
y=1.468128
y=1.468128
Passed
Week 11 : Programming Assignment 4
Due on 2023-10-12, 23:59 IST
Write a C program to check whether the given input number is Prime number or not using recursion. So, the input is an integer and output should print whether the integer is prime or not.
Note that you have to use recursion.
Public Test Cases
Input
Expected Output
Actual Output
Status
Test Case 1
13
13 is a prime number
13 is a prime number\n
Passed after ignoring Presentation Error
Test Case 2
40
40 is not a prime number
40 is not a prime number\n
Passed after ignoring Presentation Error
Week 12 : Programming Assignment 1
Due on 2023-10-19, 23:59 IST
Write a program in C to find the factorial of a given number using pointers.
Private Test cases used for Evaluation
Status
Test Case 1
Passed
Week 12 : Programming Assignment 2
Due on 2023-10-19, 23:59 IST
Write a C program to print the Record of the Student Merit wise. Here a structure variable is defined which contains student rollno, name and score.
Public Test Cases
Input
Expected Output
Actual Output
Status
Test Case 1
3
1
Santanu
700
2
Aparna
550
3
Vivek
900
The Merit List is :\n
3 Vivek 900\n
1 Santanu 700\n
2 Aparna 550
The Merit List is :\n
3 Vivek 900\n
1 Santanu 700\n
2 Aparna 550\n
Passed after ignoring Presentation Error
Week 12 : Programming Assignment 3
Due on 2023-10-19, 23:59 IST
Write a C program to store n elements using Dynamic Memory Allocation - calloc() and find the Largest element
Public Test Cases
Input
Expected Output
Actual Output
Status
Test Case 1
5
200
300
500
100
400
Largest element = 500.00
Largest element = 500.00
Passed
Week 12 : Programming Assignment 4
Due on 2023-10-19, 23:59 IST
Write a C program to find the sum of two 1D integer arrays ‘A’ and ‘B’ of same size and store the result in another array ‘C’, where the size of the array and the elements of the array are taken as input. In the Test case the input is given as follows
5
10
20
30
40
50
1
2
3
4
5
So the output will be displayed as
Result is
11
22
33
44
55
Write the program accordingly. Use dynamic memory allocation.
Public Test Cases
Input
Expected Output
Actual Output
Status
Test Case 1
5
10
20
30
40
50
1
2
3
4
5
Result is\n
11\n
22\n
33\n
44\n
55
Result is\n
11\n
22\n
33\n
44\n
55\n
Passed after ignoring Presentation Error
Test Case 2
4
100
200
300
400
400
300
200
100
Result is\n
500\n
500\n
500\n
500
Result is\n
500\n
500\n
500\n
500\n
Passed after ignoring Presentation Error
No comments:
Post a Comment
Keep your comments reader friendly. Be civil and respectful. No self-promotion or spam. Stick to the topic. Questions welcome.
No comments:
Post a Comment
Keep your comments reader friendly. Be civil and respectful. No self-promotion or spam. Stick to the topic. Questions welcome.