Computer Programming...
Lets have fun with the concepts and coding of programs in C/C++ and Java.
Thursday, 22 September 2011
Program to find all factors of a +ve number in C language
All factors of a given positive number in c
#include<stdio.h>
#include<conio.h>
void main()
{
int n,i;
clrscr();
printf("Enter the number: ");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
if(n%i==0)
printf("\n%d",i);
}
getch();
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment