CHALLENGE: Write code that will take a number and give back two numbers that add up to the number given | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 6

CHALLENGE: Write code that will take a number and give back two numbers that add up to the number given

The code will be given an input and give two numbers that when added together give the number the user gave. e.g. input: 40 output: 38 + 2 = 40 Rules: Has to give a different result each time All languages welcome good luck

5th Oct 2017, 6:14 PM
Jack
Jack - avatar
12 Answers
+ 3
Here's my answer . Just click submit as many as you want to output random addends.. https://code.sololearn.com/W1NOpB48xANB/?ref=app
6th Oct 2017, 2:32 PM
Jonathan Pizarra (JS Challenger)
Jonathan Pizarra (JS Challenger) - avatar
6th Oct 2017, 12:17 PM
m abrate
m abrate - avatar
6th Oct 2017, 2:00 PM
David Akhihiero
David Akhihiero - avatar
+ 4
https://code.sololearn.com/cx62r1rW2ixz/?ref=app
5th Oct 2017, 6:23 PM
Kartikey Sahu
Kartikey Sahu - avatar
5th Oct 2017, 8:11 PM
Ferhat Sevim
Ferhat Sevim - avatar
5th Oct 2017, 8:14 PM
Rohan K M
Rohan K M - avatar
+ 2
Did this, very similar to Ferhat's one https://code.sololearn.com/cJ9Tti7EZVRF/?ref=app
6th Oct 2017, 10:39 AM
Edoardo Compagno
Edoardo Compagno - avatar
6th Oct 2017, 1:20 AM
Sketch
Sketch - avatar
+ 1
Check This Out In C++ program https://code.sololearn.com/cNp7d9lZriba
6th Oct 2017, 5:26 AM
Aditya Narayan Mishra
Aditya  Narayan Mishra - avatar
+ 1
https://code.sololearn.com/c2ZgPR45MEeZ/?ref=app And this prints all posibilities: https://code.sololearn.com/c2kzSUX2EFOA/?ref=app
6th Oct 2017, 12:10 PM
Amr Ibrahim Khudair
Amr Ibrahim Khudair - avatar
6th Oct 2017, 2:17 PM
Paulo Matsuda Ueno
+ 1
https://code.sololearn.com/cnRY7z9A017v/?ref=app
6th Oct 2017, 9:08 PM
souma soumaya
souma soumaya - avatar