Write a program to generate prime factors of a given integer?
Answer Posted / sourav das
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k,l,n;
clrscr();
printf("Enter The Number:");
scanf("%d",&n);
i=1;
while(i<=n)
{
if(n%i==0)
{
j=1;
k=0;
l=1;
while(l<=j)
{
if(j%l==0)
k++;
l++;
}
if(k==2)
{
printf("\n%d is the prime factor of %d",l-1,n);
}
}
i++;
}
getch();
}
| Is This Answer Correct ? | 26 Yes | 24 No |
Post New Answer View All Answers
‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.
What does == mean in texting?
What is use of #include in c?
What is a null string in c?
write a program to create a sparse matrix using dynamic memory allocation.
Difference between goto, long jmp() and setjmp()?
Explain what is the concatenation operator?
What does the c in ctime mean?
What is the use of structure padding in c?
How many levels deep can include files be nested?
How pointer is different from array?
Can we declare variables anywhere in c?
What is the code for 3 questions and answer check in VisualBasic.Net?
how to create duplicate link list using C???
Is fortran still used today?