+ 1

Can we create a program in which it shows no of possiblities for order pairs of (a,b) for [a+b]=c.If yes whats the formula?

example: a+b=5, order pair of (a,b) are (1,4),(4,1),(2,3),(3,2),(5,0),(0,5). no of possiblities are 6. If you can please help? All languages are welcomed.

25th Oct 2017, 7:46 AM
Divyanshu Pandey
Divyanshu Pandey - avatar
5 Answers
+ 2
Checkout this code I wrote. This basically lists out the number of possibilities as well as the entire set of solutions. You may modify if you just require the size of the solution set. https://code.sololearn.com/cpZHxN19Jke7/?ref=app
25th Oct 2017, 5:16 PM
Anil
Anil - avatar
0
and yes, the code is in Python...
25th Oct 2017, 5:17 PM
Anil
Anil - avatar
0
yes
27th Jan 2018, 5:48 PM
Arun