Computer Science, asked by anshmaheshwari2005, 6 months ago

Write a program to input any number and print the odd digits are decreased by 1 and the and even digits are increased by 1.​

Answers

Answered by indiaananddhruv
0

Answer(in python):

n=int(input("Give a number"))

if (n % 2) == 0:

   print(n+1)

else:

   print(n-1)

Example input:4

output:5

Example input:5

output:4

Answered by shezaada
0

Answer:

the above is answer is not correct as it is in python language and you have to write in java.

Explanation:

writing the same exam vro

Similar questions