How to make a program which shows all factors of a number

This is the place for queries that don't fit in any of the other categories.

How to make a program which shows all factors of a number

Postby SomeRandom123 » Sun Jan 12, 2014 7:50 pm

I want the user to input a number then the program outputs all the factors of that number. Please help. Thanks.
Last edited by stranac on Sun Jan 12, 2014 7:54 pm, edited 1 time in total.
Reason: First post lock.
SomeRandom123
 
Posts: 1
Joined: Sun Jan 12, 2014 7:48 pm

Re: How to make a program which shows all factors of a numbe

Postby stranac » Sun Jan 12, 2014 7:56 pm

The simplest way is to loop through all the numbers up to the user's input.
If the input is divisible by a number, output it.

If you need more help, show some effort.
Don't forget to use the force...I mean code tags.
Friendship is magic!

R.I.P. Tracy M. You will be missed.
User avatar
stranac
 
Posts: 1093
Joined: Thu Feb 07, 2013 3:42 pm


Return to General Coding Help

Who is online

Users browsing this forum: Google [Bot] and 2 guests