Answer to Question #13851 in C++ for Darryl kaye Abella Sanga
Write a program that will ask the user to enter a number and display all the factor of the number.
1
2012-08-30T11:44:47-0400
#include<stdio.h>
void findfact(int num)
{
int i;
for(i=1;i<num;i++)
{
if(num%i==0)
printf("Factor for %d is
%d\n",num,i);
}
}
void main()
{
int a;
printf("\nEnter a
number:");
scanf("%d",&a);
findfact(a);
scanf("%d",&a);
}
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
C++
Comments
Leave a comment