C program to generate divisors of an integer

C program to generate divisors of an integer

Program

#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
}

Output

DURGESH

I Love python, so I like machine learning a Lot and on the other hand, I like building apps and fun games I post blogs on my website for Tech enthusiast to learn and Share Information With The World.

Leave a Reply

Your email address will not be published. Required fields are marked *

5 × 1 =

Recent Content