+ 25

[🏆 Challenge 🏆]: Pronic Numbers 🎮⚠💡🏆🔢

A pronic number is a number which is the product of 2 consecutive integers. Write a code to check if the inputted number is pronic or not an also print those 2 consecutive integers if the number is pronic Note - 0 is also a pronic number Eg- Input -> 12 Output -> 12 is pronic as 12=3*4 You can see my code too- https://code.sololearn.com/cVKRMRBDtKxD/?ref=app

18th Oct 2017, 5:13 AM
Swapnil Srivastava
Swapnil Srivastava - avatar
65 Réponses
+ 25
my code is modified ... try it now ☺👍 //upgraded to show solution using loops and quadratic both ☺ ⬜🌹🌹🌹🌹🌹⬜ 🌹⬜⬜⬜⬜⬜⬜ 🌹⬜⬜⬜⬜⬜⬜ 🌹⬜⬜⬜🌹🌹🌹 🌹⬜⬜⬜⬜⬜🌹 🌹⬜⬜⬜⬜⬜🌹 ⬜🌹🌹🌹🌹🌹⬜ https://code.sololearn.com/cZYWW7NrE6Y3/?ref=app
18th Oct 2017, 9:25 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 23
https://code.sololearn.com/cdm8Jcu28T3m/?ref=app
22nd Feb 2018, 7:41 AM
Danijel Ivanović
Danijel Ivanović - avatar
22nd Feb 2018, 7:03 AM
Danijel Ivanović
Danijel Ivanović - avatar
+ 16
https://code.sololearn.com/cB6IfkFI0Uho/?ref=app
18th Oct 2017, 7:24 PM
Vukan
Vukan - avatar
22nd Feb 2018, 9:14 AM
MeanMachine
MeanMachine - avatar
18th Oct 2017, 6:17 AM
noobcøder
noobcøder - avatar
+ 14
Here's my C# implementation! ✌ I'm inclined for Maths related challenge and this is really interesting. Special thanks to Oma Falk for the insight! Enjoy~ ❤ https://code.sololearn.com/c9139Lvylj22/?ref=app
18th Oct 2017, 11:58 AM
Zephyr Koo
Zephyr Koo - avatar
18th Oct 2017, 7:55 AM
Edward Fish
Edward Fish - avatar
18th Oct 2017, 8:25 AM
David Akhihiero
David Akhihiero - avatar
7th Nov 2017, 6:17 PM
AZTECCO
AZTECCO - avatar
+ 11
heja I found a very simple solution 😉😉 https://code.sololearn.com/c8Zv37VrY5NV/?ref=app
18th Oct 2017, 8:59 AM
Oma Falk
Oma Falk - avatar
+ 10
https://code.sololearn.com/c6LzV20tL4KU/?ref=app
19th Oct 2017, 2:27 PM
The Mir-acle
The Mir-acle - avatar
+ 9
@Swapnil: Mine updated to include zero ;)
18th Oct 2017, 7:35 AM
noobcøder
noobcøder - avatar
+ 8
I had told that 0 was also a pronic number. But many codes don't output that. Otherwise all nice codes.
18th Oct 2017, 7:29 AM
Swapnil Srivastava
Swapnil Srivastava - avatar
+ 8
@Oma Falk Basically it's a nice trick of completing the square for the expression n(n + 1). 😉
18th Oct 2017, 3:18 PM
Zephyr Koo
Zephyr Koo - avatar
+ 8
a further simple pronic tester (-: https://code.sololearn.com/cMTTl39AO1g7/?ref=app
18th Oct 2017, 6:09 PM
Oma Falk
Oma Falk - avatar
+ 7
@VcC your code is fast but it is neither user friendly nor does it show which 2 integers make it pronic. Otherwise good code. EDIT: Now no problems with the code.
18th Oct 2017, 7:27 AM
Swapnil Srivastava
Swapnil Srivastava - avatar
18th Oct 2017, 11:49 AM
Abhishek Tandon
Abhishek Tandon - avatar
+ 7
https://code.sololearn.com/cRcur9eLc83l/?ref=app
21st Oct 2017, 11:43 AM
Ayush Agarwal
Ayush Agarwal - avatar