Write a program to generate prime factors of a given integer?
Answer Posted / priyanka chauhan
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,n;
clrscr();
printf("Enter the no: ");
scanf("%d",&n);
for(j=2;j<=n;j++)
{
if(n%j==0)
{
for(i=2;i<=j-1;i++)
{
if(j%i==0)
break;
}
if(i==j)
printf("%d ",j);
}
}
getch();
}
| Is This Answer Correct ? | 23 Yes | 18 No |
Post New Answer View All Answers
how to write a c program to print list of fruits in alpabetical order?
Why is #define used?
Iam a B.Tech graduate and completed my engineering in 2009, from 2005 to 2009 and after that i had done nothing.Now i want to do job and get into BPO field . Friends give me suggestions as what to say in interview... if they ask me that what would you had done ... these many years without doing job ??????? pls urgent
What does %2f mean in c?
What is the size of structure in c?
What is the value of h?
What are different types of pointers?
Write a program, where i have a grid with many cells, how many paths are possible from one point to other desired points.
What is the difference between class and object in c?
What is a lvalue
A collection of functions,calls,subroutines or other data a) library b) header files c) set of files d) textfiles
Can you mix old-style and new-style function syntax?
Is it cc or c in a letter?
What is zero based addressing?
What are identifiers in c?