Write a C Program to calculates the area (floating point number with two decimal places) of a Circle given it’s radius (integer value). The value of Pi is 3.14. [Marks for Week 3 Programming assignments will not be evaluated finally. This is for users to get familiar with programming in google course builder platform]
Public Test Cases
Input
Expected Output
Actual Output
Status
Test Case 1
42
Area of a circle = 5538.96
Area of a circle = 5538.96
Passed
Test Case 2
50
Area of a circle = 7850.00
Area of a circle = 7850.00
Passed
Private Test cases used for Evaluation
Status
Test Case 1
Passed
Week-03: Program-02
Due on 2022-08-18, 23:59 IST
Write a C program to check if a given Number is zero or Positive or Negative Using if...else statement.
[Week 3 programming assignments will not be considered for final evaluation]
Public Test Cases
Input
Expected Output
Actual Output
Status
Test Case 1
14.05
Positive number.
Positive number.
Passed
Test Case 2
0.45
Positive number.
Positive number.
Passed
Test Case 3
-0.9
Negative number.
Negative number.
Passed
Private Test cases used for Evaluation
Status
Test Case 1
Passed
Test Case 2
Passed
Week-03: Program-03
Due on 2022-08-18, 23:59 IST
Write a C program to check whether a given number (integer) is Even or Odd. [This program does not carry any marks.]
Public Test Cases
Input
Expected Output
Actual Output
Status
Test Case 1
116
116 is even.
116 is even.
Passed
Test Case 2
51
51 is odd.
51 is odd.
Passed
Private Test cases used for Evaluation
Status
Test Case 1
Passed
Test Case 2
Passed
Week-03 Program-04
Due on 2022-08-18, 23:59 IST
Write a C Program to find the Largest Number (integer) among Three Numbers (integers) using IF and Logical && operator. [Week 3 programming assignments will not be considered for final evaluation]
Write a C Program to Find the Smallest Number among Three Numbers (integer values) using Nested IF-Else statement.
Public Test Cases
Input
Expected Output
Actual Output
Status
Test Case 1
20 100 50
20 is the smallest number.
20 is the smallest number.
Passed
Test Case 2
90 45 -81
-81 is the smallest number.
-81 is the smallest number.
Passed
Private Test cases used for Evaluation
Status
Test Case 1
Passed
Test Case 2
Passed
Week-04 Problem-02
Due on 2022-08-25, 23:59 IST
Write a program to find whether a given character is a Vowel or consonant. A character is taken as input. The character may be in Upper Case or in Lower Case.
Public Test Cases
Input
Expected Output
Actual Output
Status
Test Case 1
C
C is a consonant.
C is a consonant.
Passed
Test Case 2
U
U is a vowel.
U is a vowel.
Passed
Private Test cases used for Evaluation
Status
Test Case 1
Passed
Test Case 2
Passed
Week-04 Problem-03
Due on 2022-08-25, 23:59 IST
Write a C program to calculate the Sum of First and the Last Digit of a given Number. For example if the number is 1234 the result is 1+ 4 = 5.
Public Test Cases
Input
Expected Output
Actual Output
Status
Test Case 1
2908
Sum of First and Last digit = 10
Sum of First and Last digit = 10
Passed
Test Case 2
20008
Sum of First and Last digit = 10
Sum of First and Last digit = 10
Passed
Private Test cases used for Evaluation
Status
Test Case 1
Passed
Test Case 2
Passed
Week-04: Program-04
Due on 2022-08-25, 23:59 IST
Write a C program to find power of a number using while loops. The base number (>0) and exponent (>=0) is taken from the test cases.
Write a C program to count total number of digits of an Integer number (N).
Public Test Cases
Input
Expected Output
Actual Output
Status
Test Case 1
3456
The number 3456 contains 4 digits.
The number 3456 contains 4 digits.
Passed
Test Case 2
570
The number 570 contains 3 digits.
The number 570 contains 3 digits.
Passed
Private Test cases used for Evaluation
Status
Test Case 1
Passed
Test Case 2
Passed
Week-05 Problem-02
Due on 2022-09-01, 23:59 IST
Write a C program to find sum of following series where the value of N is taken as input
1+ 1/2 + 1/3 + 1/4 + 1/5 + .. 1/N
Public Test Cases
Input
Expected Output
Actual Output
Status
Test Case 1
100
Sum of the series is: 5.19\n
Sum of the series is: 5.19\n
Passed
Test Case 2
20
Sum of the series is: 3.60\n
Sum of the series is: 3.60\n
Passed
Private Test cases used for Evaluation
Status
Test Case 1
Passed
Test Case 2
Passed
Week-05 Problem-03
Due on 2022-09-01, 23:59 IST
Write a C program to check whether the given number(N) can be expressed as Power of Two (2) or not. For example 8 can be expressed as 2^3.
Public Test Cases
Input
Expected Output
Actual Output
Status
Test Case 1
8
8 is a number that can be expressed as power of 2.
8 is a number that can be expressed as power of 2.
Passed
Test Case 2
6572
6572 cannot be expressed as power of 2.
6572 cannot be expressed as power of 2.
Passed
Private Test cases used for Evaluation
Status
Test Case 1
Passed
Test Case 2
Passed
Week-05 Program-04
Due on 2022-09-01, 23:59 IST
Write a C program to print the following Pyramid pattern upto Nth row. Where N (number of rows to be printed) is taken as input. For example when the value of N is 5 the pyramid will be printed as follows
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);
Public Test Cases
Input
Expected Output
Actual Output
Status
Test Case 1
5
10
50
40
30
20
Largest element = 50
Largest element = 50
Passed
Test Case 2
7
100
50
60
70
90
30
40
Largest element = 100
Largest element = 100
Passed
Private Test cases used for Evaluation
Status
Test Case 1
Passed
Test Case 2
Passed
Week-06 Program-02
Due on 2022-09-08, 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.
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\n
5\n
4\n
3\n
2\n
1\n
Passed
Test Case 2
4
45
65
35
25
25\n
35\n
65\n
45\n
25\n
35\n
65\n
45\n
Passed
Private Test cases used for Evaluation
Status
Test Case 1
Passed
Test Case 2
Passed
Week-06 Program-03
Due on 2022-09-08, 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\n
10\n
20\n
30\n
40\n
50\n
60\n
70\n
Passed
Test Case 2
4
9
7
6
5
2
30
50
9\n
7\n
6\n
5\n
30\n
50\n
9\n
7\n
6\n
5\n
30\n
50\n
Passed
Private Test cases used for Evaluation
Status
Test Case 1
Passed
Test Case 2
Passed
Week-06 Program-04
Due on 2022-09-08, 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\n
50\n
60\n
30\n
20\n
Passed
Test Case 2
6
40
20
50
30
20
10
40\n
20\n
50\n
30\n
10\n
40\n
20\n
50\n
30\n
10\n
Passed
Private Test cases used for Evaluation
Status
Test Case 1
Passed
Test Case 2
Passed
Week-07 Program-01
Due on 2022-09-15, 23:59 IST
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
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
Private Test cases used for Evaluation
Status
Test Case 1
Passed
Test Case 2
Passed
Week-07 Program-02
Due on 2022-09-15, 23:59 IST
Write a C program to find subtraction of two matrices i.e. matrix_A - matrix_B=matrix_C. If the given martix are 2 3 5 and 1 5 2 Then the output will be 1 -2 3 4 5 6 2 3 4 2 2 2 6 5 7 3 3 4 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
Private Test cases used for Evaluation
Status
Test Case 1
Passed
Week-07 Program-03
Due on 2022-09-15, 23:59 IST
Write a C program to print lower triangle of a square matrix. For example the output of a given matrix 2 3 4 will be 2 0 0 5 6 7 5 6 0 4 5 6 4 5 6
Public Test Cases
Input
Expected Output
Actual Output
Status
Test Case 1
3
1
2
3
1
2
3
1
2
3
1 0 0 \n
1 2 0 \n
1 2 3 \n
1 0 0 \n
1 2 0 \n
1 2 3 \n
Passed
Private Test cases used for Evaluation
Status
Test Case 1
Passed
Week-07 Program-04
Due on 2022-09-15, 23:59 IST
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\n
Largest Word is: initiative\n
Smallest word is: a\n
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.