C Program to find divisors of a given Integer
Sorry for not bringing enough contents in this summer. Well, I was busy.
Today we will learn a C program which can calculate the divisors of a given number. It is easy. You can see the Source Code below...
//Program for finding integer divisors of an number
#include<stdio.h>void main()
{
int num,div,ans;
printf("Enter the number\n");
scanf("%d",&num);
for(div=2;div<=num;div++)
if(num%div==0)
printf("The divisor is %d\n",div);
}
Comments
Post a Comment
Add your comment here...