#include<stdio.h>
#define factor(num) {do{if(num%a==0){num=(num/a);printf("\n%d",a);}else a++;}while(num!=1);}
void main()
{
int a=2,num;
printf("enter the number\n");
scanf("%d",&num);
printf("%d",1);
factor(num);
}
#define factor(num) {do{if(num%a==0){num=(num/a);printf("\n%d",a);}else a++;}while(num!=1);}
void main()
{
int a=2,num;
printf("enter the number\n");
scanf("%d",&num);
printf("%d",1);
factor(num);
}
NOTE- i have compiled this program in codeblocks if u do it in turbo c++ use conio.h header file in the beginning and getch() a the last.
output image (click to enlarge).
No comments:
Post a Comment