How to find factors and lcm and gcd of given numbers

sir pls help me in this I having some confusion when I solving the assignment that you have send to me

For factor-
start a loop from i=0 to n(n=number whose factors you want)
in the loop check the condition if(i%n)==0 (if it is true then i is a factor of n since the remainder of division of both the numbers will be zero)
now in if you can print(i) if you want to display the factors.

For gcd and lcm-
https://online.codingblocks.com/courses/data-structures-and-algorithms-online-course in this link you will find videos explaining the concept of gcd and lcm (under the number theory section which is free to watch for everyone). Number theory will be present in the section saying “What will you learn-” scroll down in that section and preview these videos.

In case after understanding the concept of these topics if you are unable to write the code for same then let me know and i will help you with it.

1 Like

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

1 Like