The C Programs
An ultimate blog where you can find almost all C programs.....!!
Pages
Home
Contact Us
Tuesday 22 May 2012
C program to generate divisors of an integer
#include<stdio.h>
#include<conio.h>
void main()
{
int i,n;
clrscr(); //to clear the screen
printf("Enter any number:");
scanf("%d",&n);
printf("\nDivisors of %d are",n);
for(i=1;i<n/2;++i)
if(n%i==0)
printf(" %d",i);
getch(); //to stop the screen
}
C program to generate divisors of an integer
2012-05-22T12:47:00-07:00
Neeraj Mishra
loop|
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)