The program accepts an integer N and prints the value of N+1 if N is less than 10 and prints value N-1
Answers
Answered by
3
Language:
Python
Program:
n=int(input("Enter a number: "))
if n<10:
print(n+1)
else:
print(n-1)
Input/Ouput:
Enter a number: 5
6
Enter a number: 45
44
Explanation:
- n accepts a number
- using else-if statements we get the desired output.
Similar questions
Math,
4 hours ago
English,
8 hours ago
English,
8 hours ago
Social Sciences,
7 months ago
History,
7 months ago