NPTEL » Problem Solving Through Programming In C
Subscribe to our YouTube Channel : Swayam Solver
Week-07: Program-01
Due on 2022-03-17, 23:59 ISTWrite a C Program to Count Number of Uppercase and Lowercase Letters in a given string. The given string may be a word or a sentence.
Public Test Cases Input Expected Output Actual Output Status Test Case 1 National Programme on Technology Enhanced Learning is a joint initiative of the IITs and IISc.
Uppercase Letters : 11\n
Lowercase Letters : 68\n
Uppercase Letters : 11\n
Lowercase Letters : 68
Passed after ignoring Presentation Error
Test Case 2 Problem Solving through Programming in C.
Uppercase Letters : 4\n
Lowercase Letters : 31\n
Uppercase Letters : 4\n
Lowercase Letters : 31
Passed after ignoring Presentation Error
Write a C Program to Count Number of Uppercase and Lowercase Letters in a given string. The given string may be a word or a sentence.
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1 | National Programme on Technology Enhanced Learning is a joint initiative of the IITs and IISc. | Uppercase Letters : 11\n
Lowercase Letters : 68\n
| Uppercase Letters : 11\n
Lowercase Letters : 68 | Passed after ignoring Presentation Error |
Test Case 2 | Problem Solving through Programming in C. | Uppercase Letters : 4\n
Lowercase Letters : 31\n
| Uppercase Letters : 4\n
Lowercase Letters : 31 | Passed after ignoring Presentation Error |
Private Test cases used for Evaluation | Status |
Test Case 1 | Passed |
Test Case 2 | Passed |
Week-07 Program-02
Due on 2022-03-17, 23:59 ISTWrite a C program to find the sum of all elements of each row of a matrix.
Example: For a matrix
4 5 6
6 7 3
1 2 3
The output will be
15
16
6
Public Test Cases Input Expected Output Actual Output Status Test Case 1 3
3
1
1
1
2
2
2
3
3
3
3\n
6\n
9\n
3\n
6\n
9\n
Passed
Test Case 2 2
3
1
2
3
4
5
6
6\n
15\n
6\n
15\n
Passed
Write a C program to find the sum of all elements of each row of a matrix.
Example: For a matrix
4 5 6
6 7 3
1 2 3
The output will be
15
16
6
Example: For a matrix
4 5 6
6 7 3
1 2 3
The output will be
15
16
6
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1 | 3
3
1
1
1
2
2
2
3
3
3
| 3\n
6\n
9\n
| 3\n
6\n
9\n
| Passed |
Test Case 2 | 2
3
1
2
3
4
5
6
| 6\n
15\n
| 6\n
15\n
| Passed |
|
Week-07 Program-03
Due on 2022-03-17, 23:59 ISTWrite a C program to find subtraction of two matrices i.e. matrix_A - matrix_B = matrix_C.
If the given matrix are
2 3 5 and 1 5 2
4 5 6 2 3 4
6 5 7 3 3 4
Then the output will be
1 -2 3
2 2 2
3 2 3
(The elements of the output matrix are separated by one blank space)
Public Test Cases Input Expected Output Actual Output Status Test Case 1 3
3
2
3
5
4
5
6
6
5
7
1
5
2
2
3
4
3
3
4
1 -2 3 \n
2 2 2 \n
3 2 3\n
1 -2 3 \n
2 2 2 \n
3 2 3 \n
Passed after ignoring Presentation Error
Write a C program to find subtraction of two matrices i.e. matrix_A - matrix_B = matrix_C.
If the given matrix are
2 3 5 and 1 5 2
4 5 6 2 3 4
6 5 7 3 3 4
Then the output will be
1 -2 3
2 2 2
3 2 3
(The elements of the output matrix are separated by one blank space)
If the given matrix are
2 3 5 and 1 5 2
4 5 6 2 3 4
6 5 7 3 3 4
Then the output will be
1 -2 3
2 2 2
3 2 3
(The elements of the output matrix are separated by one blank space)
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1 | 3
3
2
3
5
4
5
6
6
5
7
1
5
2
2
3
4
3
3
4
| 1 -2 3 \n
2 2 2 \n
3 2 3\n
| 1 -2 3 \n
2 2 2 \n
3 2 3 \n
| Passed after ignoring Presentation Error |
Private Test cases used for Evaluation | Status |
Test Case 1 | Passed |
Week-07 Program-04
Due on 2022-03-17, 23:59 ISTWrite a C program to print Largest and Smallest Word from a given sentence. If there are two or more words of same length, then the first one is considered. A single letter in the sentence is also consider as a word.
Public Test Cases Input Expected Output Actual Output Status Test Case 1 Problem Solving through Programming in C.
Largest Word is: Programming\n
Smallest word is: C\n
Largest Word is: Programming\n
Smallest word is: C\n
Passed
Test Case 2 NPTEL is a joint initiative of the IITs and IISc.
Largest Word is: initiative\n
Smallest word is: a
Largest Word is: initiative\n
Smallest word is: a\n
Passed after ignoring Presentation Error
Write a C program to print Largest and Smallest Word from a given sentence. If there are two or more words of same length, then the first one is considered. A single letter in the sentence is also consider as a word.
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1 | Problem Solving through Programming in C. | Largest Word is: Programming\n
Smallest word is: C\n
| Largest Word is: Programming\n
Smallest word is: C\n
| Passed |
Test Case 2 | NPTEL is a joint initiative of the IITs and IISc. | Largest Word is: initiative\n
Smallest word is: a | Largest Word is: initiative\n
Smallest word is: a\n
| Passed after ignoring Presentation Error |
|
Watch the video to see the program in motion.
Please Subscribe to our YouTube Channel : Swayam Solver
This will help the creator to continue making quality content...
Have a great day !
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.