Name: Possible Factor
Description: This program displays the possible factors of a number. Enter any number and the possible factors of this number will appear.
Below is the screenshot of this program. Click to see it fully.
As you can see in the picture above, I entered the number 9999 and the possible factors of this number appeared.
//Codes:
#include <math.h>
#include <conio.h>
#include <iostream.h>
int main()
{int b;
cout<<"Enter the number that you want to get the possible factor: ";
cin>>b;
for(int x=1;x<=b;x++)
{
if(b%x==0)
cout<<","<<b/x;
}
getch();
}
//Codes:
#include <math.h>
#include <conio.h>
#include <iostream.h>
int main()
{int b;
cout<<"Enter the number that you want to get the possible factor: ";
cin>>b;
for(int x=1;x<=b;x++)
{
if(b%x==0)
cout<<","<<b/x;
}
getch();
}