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
Explain the array representation of a binary tree in C.
How many keywords are there in c?
What does char * * argv mean in c?
Why c is called procedure oriented language?
What is the use of bitwise operator?
What is the purpose of main( ) in c language?
What is c programing language?
What should malloc() do? Return a null pointer or a pointer to 0 bytes?
a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode
What are keywords in c with examples?
Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?
Explain how do you search data in a data file using random access method?
What do you mean by recursion in c?
How will you write a code for accessing the length of an array without assigning it to another variable?
Do you know what are the properties of union in c?