Assignment - (PCC DS 391) - Day-2 - GR-X
Assignment - (PCC DS 391) - Day-2 - GR-X
2. Write a program to accept a number from a user and calculate the sum of all numbers from 1 to a
given number
For example, 0, 1, 1, 2, 3, 5, 8, 13, 21. The next number in this series above is 13+21 = 34.
76542
Expected output:
24567
8. Calculate the cube of all numbers from 1 to a given number, Write a program to print the cube of all
numbers from 1 to a given number
Given:
input_number = 6
9. Find the sum of the series upto n terms, Write a program to calculate the sum of series up to n term.
For example, if n =5 the series will become 2 + 22 + 222 + 2222 + 22222 = 24690
10. Print First 10 natural numbers using while loop