Wednesday, 27 February 2013

Factor Program


By on 02:28

Factor Program in C language:-

Q)Write a program in c language to enter a value and print factor of this number/value.


Note:-You can also create this program in java,c#,c++(c plus plus) etc. with the same logic.



P:#include<stdio.h>
void main()
{
int i,x;
printf("enter no.");
scanf("%d",&x);
for(i=0;i<=x;i++)
{
if(n%i==0)
printf("%d",i);
}
getch();
}

If you have any query then leave your comments and don't forgot to follow me on Google+,Facebook,Twitter.

0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...