Write a program to generate prime factors of a given integer?
Answer Posted / neha
#include<stdio.h>
#include<conio.h>
int main()
{
int num,i=1,j,k;
printf("\n\tEnter the number:");
scanf("%d",&num);
while(i<=num)
{
k=0;
if(num%i==0)
{
j=1;
while(j<=i)
{
if(i%j==0)
k++;
}
j++;
if(k==2)
printf("\n\t%d is a Prime factor:"i);
}
i++;
}
return 0;
}
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What are linker error?
How to compare array with pointer in c?
How can you invoke another program from within a C program?
What are the different properties of variable number of arguments?
general for is %wd,f-d; in this system "w" means a) 'w' represent total width of digits b) 'w' represent width which includes the digits before,after decimal place and the decimal point c) 'w' represent width which includes the digits before only d) 'w' represent width after decimal place only
HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????
write a program to generate address labels using structures?
Is null valid for pointers to functions?
Is c object oriented?
What is difference between stdio h and conio h?
which is an algorithm for sorting in a growing Lexicographic order
Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop
When c language was developed?
Explain what math functions are available for integers? For floating point?
What is a lvalue