# include <stdio.h>
# include <conio.h>
void main()
{
int i, n ;
clrscr() ;
printf("Enter the number : ") ;
scanf("%d", &n) ;
printf("\nThe divisors are :\n\n") ;
for(i = 1 ; i <= n ; i++)
if(n % i == 0)
printf("%d\t", i) ;
getch() ;
}
RUN 1 :
~~~~~~~
Enter the number : 15
The divisors are :
1 3 5 15
# include <conio.h>
void main()
{
int i, n ;
clrscr() ;
printf("Enter the number : ") ;
scanf("%d", &n) ;
printf("\nThe divisors are :\n\n") ;
for(i = 1 ; i <= n ; i++)
if(n % i == 0)
printf("%d\t", i) ;
getch() ;
}
RUN 1 :
~~~~~~~
Enter the number : 15
The divisors are :
1 3 5 15
No comments:
Post a Comment