Calculate Double or Triple
Write a program to print the triple of number
The first line is an integer
The output should be an integer based on the above conditions.
In the given example
N = 3, As 3 is a multiple of 3, we multiply the value by 3. So, the output should be 9.
Sample Input 1
3
Sample Output 1
9
Sample Input 2
4
Sample Output 2
8
N = int(input())
if N % 3 == 0:
N *= 3
else:
N *= 2
print(N)
Comments
Leave a comment