Elements in the Range
You are given three numbers. Check if any of the numbers exist in the range from 10 to 20 (including 10 and 20).
The first, second, and third lines of input are integers.
The output should be either
Given
a = 2, b = 4, c = 16, 16 is in the range between 10 and 20.So the output should be
True
Write a program that reads a single line of input and prints the first and last characters of the given input and prints the asterisk character (*) in place of the remaining characters.Input
Sum of the series
Write a program to find the sum S of the series where S = x - x^3 + x^5 + ....... upto N terms.
Input
The first line of input is an integer X. The second line of input is an integer N.
Explanation
If we take X value as 2 in the series upto 5 terms.
Then the series is 2 - 23 + 25 - 27 + 29
So, the output should be
410.
Sample Input 1
2
5
Sample Output 1
410
Sample Input 2
3
2
Sample Output 2
-24
Right Angled Triangle - 3
Given an integer number N as input. Write a program to print the right-angled triangular pattern of N rows as shown below.
Input
The first line of input is a positive integer.
For example, if the given number is
5, the output should be
______
| /
| /
| /
| /
|/
Sample Input 1
5
Sample Output 1
______
| /
| /
| /
| /
|/
Sample Input 2
7
Sample Output 2
________
| /
| /
| /
| /
| /
| /
|/
Hollow Right Triangle - 2
Given an integer number N as input. Write a program to print the hollow right-angled triangular pattern of N lines as shown below.
Note: There is a space after each asterisk (*) character.
Input
The first line of input is an integer N.
Explanation
In the given example the hollow right angled triangle of side
5. Therefore, the output should be
*
* *
* *
* *
* * * * *
Sample Input 1
4
Sample Output 1
*
* *
* *
* * * *
Sample Input 2
5
Sample Output 2
*
* *
* *
* *
* * * * *