How to print all divisors of a number

[Question] Print all divisors of a given number For example divisors of 36 are = 1,2,3,4,5,9,12,18,36#Approach: We can find square root of a given number & check if its perfectly divisible sqrt numbers