Friday, 19 September 2014

WAP to generate the divisor of number.

#include<conio.h>
#include<stdio.h>
void main()
{
clrscr();
int a;
printf("\nEnter valid no. to generate Divisor : ");
scanf("%d",&a);
printf("\n Divisors are  ");
for(int i=1;i<=a/2;i++)
{
if(a%i==0)
{
printf("%d ",i);
}
}
getch();
}

No comments:

Post a Comment

Please write your doubts