- Find next 40 leap years from current year
input: none,
output: 2020, 2024, 2028 ,2032 ,2036
- Get a number from user and print table of the number
Input: 2 // use prompt to take input
Output: 2, 4, 6, 8, 10, 12, 14, 16, 18, 20
- Print the sum of infinite series +1, -1, +1, -1 ...
input: n(3)
output: 1
input : 4
output: 0
- Program for length of the longest word in a sentence
Input: A Community of software developers supporting modern web
Output: Longest word\'s length = 10
- Find if string starts and ends with another given string
Input: konfnityMemberFeatures = "konfinityMemberninja",hasFeature="ninja"
output: yes
Input: konfinityMemberFeatures = "konfinityMemberninja", hasFeature="lull"
output: No
- Program to print GP ( Geomaetric Progression)
Input: startingTerm=2 commonRatio=2 numberOfItems=5
output: 2 4 8 16 32
hint: Gp series is like= 2, 4, 8, 16, 32, 64... Try to find the pattern into the sequence. In above sequence 2 is the starting term, 2 is the commonRatio and 6 is numberOfItems.