Skip to content
Sign upLog in
← Back to Community
6.2. While: Least divisor
Profile icon
pole55

"Given an integer not less than 2. Print its smallest integer divisor greater than 1."

Example input
15

Example output
3

Voters
Profile icon
EstebanGrado
Profile icon
ClaraBelauste
Profile icon
Dev85
Profile icon
LucasMartins42
Profile icon
stu1081148
Profile icon
stu1081140
Profile icon
msayda01
Profile icon
Ematrone
Profile icon
YvetteAlvarez
Profile icon
KatiRupp
Comments
hotnewtop
Profile icon
NathanMulate

Can you do this in a while loop?