Week 5 : Programming Assignment 1
Due on 2023-08-31, 23:59 IST
Write a C program to check whether a given number (N) is a perfect number or not.
[Perfect Number - A perfect number is a positive integer number which is equals to the sum of its proper positive divisors. For example 6 is a perfect number because its proper divisors are 1, 2, 3 and it’s sum is equals to 6.]
[Perfect Number - A perfect number is a positive integer number which is equals to the sum of its proper positive divisors. For example 6 is a perfect number because its proper divisors are 1, 2, 3 and it’s sum is equals to 6.]
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1 | 6 | 6 is a perfect number. | 6 is a perfect number. | Passed |
Test Case 2 | 87 | 87 is not a perfect number. | 87 is not a perfect number. | Passed |
Week 5 : Programming Assignment 2
Due on 2023-08-31, 23:59 IST
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 | 3008 | The number 3008 contains 4 digits. | The number 3008 contains 4 digits. | Passed |
Test Case 2 | 123456 | The number 123456 contains 6 digits. | The number 123456 contains 6 digits. | Passed |
Week 5 : Programming Assignment 3
Due on 2023-08-31, 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.
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 | 66 | 66 cannot be expressed as power of 2. | 66 cannot be expressed as power of 2. | Passed |
Week 5 : Programming Assignment 4
Due on 2023-08-31, 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
1+ 1/2 + 1/3 + 1/4 + 1/5 + .. 1/N
Public Test Cases | Input | Expected Output | Actual Output | Status |
---|---|---|---|---|
Test Case 1 | 6 | Sum of the series is: 2.45 | Sum of the series is: 2.45 | Passed |
Test Case 2 | 50 | Sum of the series is: 4.50 | Sum of the series is: 4.50 | Passed |
No comments