Sum OR Difference||codechef||beginner solution ||programming info

Sum OR Difference

Write a program to take two numbers as input and print their difference if the first number is greater than the second number otherwise print their sum.

Input:

  • First line will contain the first number (N1)
  • Second line will contain the second number (N2)

Output:

Output a single line containing the difference of 2 numbers (N1N2) if the first number is greater than the second number otherwise output their sum (N1+N2).

Constraints

  • 1000N11000
  • 1000N21000

Sample Input:

82
28

Sample Output:

54
Share:

No comments:

Post a Comment

Translate

Recommended platforms

  1. codechef
  2. hackerrank
  3. codeforces
  4. leetcode
  5. hackerearth

Popular Posts

programming_info. Powered by Blogger.

Blog Archive

Recent Posts

other platforms

  • geeks for geeks
  • w3schools
  • codepen
  • skillshare
  • udemy

Pages

reader support Support