You are given an integer N. Find the largest integer between 1 and N which divides N. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

You are given an integer N. Find the largest integer between 1 and N which divides N.

I wanted to know is there a way to find max of nos in a loop.. https://code.sololearn.com/cfFj5FuEWNPC/?ref=app

5th Feb 2021, 4:27 PM
Aditya
Aditya - avatar
7 Answers
+ 5
Ipang actually I wanted to know is their a way to find max of nos after looping it 😅 Sounds cringe but wanted to try a lil different
5th Feb 2021, 5:06 PM
Aditya
Aditya - avatar
+ 4
What did you actually mean by "max of nos in loop"? didn't the task say to find largest number between 1 ~ 10 that fully divides the input number?
5th Feb 2021, 4:51 PM
Ipang
+ 4
@Mr perfect thanks visph thanks🙌
5th Feb 2021, 5:06 PM
Aditya
Aditya - avatar
+ 4
Yes the question was among the range but I wanted to find max of all factors..in the loop I'll modify the question
5th Feb 2021, 5:15 PM
Aditya
Aditya - avatar
+ 3
did you want to find only max (greater) factor >= 1 and <= 10 or max (all) factors in this range?
5th Feb 2021, 5:09 PM
visph
visph - avatar
+ 2
https://code.sololearn.com/c0O9rZrl1f74/?ref=app (problem description modified in comments) Aditya(Less active) edit: oups, corrections done!
5th Feb 2021, 5:20 PM
visph
visph - avatar