You are given the temperature T of an object in one of Celsius, Fahrenheit, and Kelvin scales. Write a program to print T in all scales viz Celsius, Fahrenheit, and Kelvin. Formula to convert from Fahrenheit F to Celsius C is C = (F - 32) * 5 / 9. Formula to convert from Kelvin K to Celsius C is C = K - 273
Striped Rectangle
Given an integer number M, N as input. Write a program to print a striped rectangular pattern of M rows and N columns using (+ and -) character.
Input
The first line of input is an integer M. The second line of input is an integer N.
Explanation
In the given example the striped rectangular pattern of
7 rows and 5 columns. Therefore, the output should be
+ + + + +
- - - -
+ + + + +
- - - - -
+ + + + +
- - - - -
+ + + + +
Sample Input 1
5
7
Sample Output 1
+ + + + + + +
- - - - - - -
+ + + + + + +
- - - - - - -
+ + + + + + +
Sample Input 2
7
5
Sample Output 2
+ + + + +
- - - - -
+ + + + +
- - - - -
+ + + + +
- - - - -
+ + + + +
Composite Number
Given an integer N, write a program to find if the given number is a composite number or not. If it is composite, print True or else print False.
Input
The first line of input is an integer N.
Output
The output should be True or False.
Explanation
In the given example,
12 is a composite number as it can be divisible by 1, 2, 3, 4, 6, 12.Therefore, the output should be
True.
Sample Input 1
12
Sample Output 1
True
Sample Input 2
3
Sample Output 2
False
Sum of Odd Numbers
Write a program to find the sum of odd numbers in first N natural numbers.
Input
The input is an integer N.
Output
The output should be an integer containing the sum of odd numbers up to the given number.
In the given example sum of odd numbers less than
N = 10 are total = 1 + 3 + 5 + 7 + 9
So, the output should be
25.
Sample Input 1
10
Sample Output 1
25
Sample Input 2
5
Sample Output 2
9
Sum of Even numbers
Write a program to find the sum of even numbers in first N natural numbers.
Input
The input is an integer N.
Output
The output should be an integer containing the sum of even numbers upto the given number.
In the given example
N = 5, the even natural numbers below 5 are 2, 4 Then total = 2 + 4
So, the output should be
6.
Sample Input 1
5
Sample Output 1
6
Sample Input 2
4
Sample Output 2
6