user inputs a number and 'wants' to be told the factors of that number
what is a 'factor'
factor=division of the number inputted by another number which gives a remainder of zero
in other words
factor=(input/anumber==r0)
however, all the factors of the input must be displayed
so a test must be done for valid factors
'if factor is true, then display anumber used in factor formula'
'otherwise, if not true, then test the next number after the previously tested anumber until the input is reached, since every real/whole number has at least 2 factors (1 and the number itself)'
#include <stdio.h>
int main(void)
{
int factor=0;
int input=0;
int anumber=2;
printf("Enter a number (1-5000):");
scanf("%d",&input);
factor=(input%anumber);
if(factor>=1)
printf("The factors for %d are 1, & %d.",input,input);
else
{
while(factor==0)
{
printf(", %d",anumber);
anumber=anumber+1;
}