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
illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question
explain what are actual arguments?
Explain pointer. What are function pointers in C?
Is there a way to compare two structure variables?
What is anagram in c?
Describe explain how arrays can be passed to a user defined function
What is the use of getch ()?
how to introdu5ce my self in serco
can anyone suggest some site name..where i can get some good data structure puzzles???
Explain what math functions are available for integers? For floating point?
Mention four important string handling functions in c languages .
What is nested structure in c?
can we have joblib in a proc ?
What is a dynamic array in c?
What is structure packing in c?