Implement the following function:
def Calculate(n, m):
The function accepts two integers 'n' and 'm'. You have to find and return the result according to following conditions:
If n > m, return (n * m) - (n - m) i.e. difference of n*m and n-m.
• If n <= m, return (m %n) - (m + n) i.e. difference of m%n and m+n.
Assumption:
• n is not equal to 0.
Each computation lies within integral range.
Example:
Input:
n: 28
m: 2
Output:
30
Explanation:
Since n > m, so (n*m) - (n-m) = (28*2) - (28-2) = 30, thus output is 30.
Sample Input
n: 5
m: 13
Sample Output
-15
Answers
Answered by
0
Answer:
hidtunlifsdbjtrsat biot
Answered by
0
Answer:
jdkjdnxjxkkxjfjdkddkckkckcmdjdk
Similar questions