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
swap 2 numbers without using third variable?
What does the message "automatic aggregate intialization is an ansi feature" mean?
Is c# a good language?
What is putchar() function?
What is header file in c?
how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.
Explain what are binary trees?
What is structure data type in c?
What is the difference between NULL and NUL?
What is the difference between int main and void main in c?
How do we make a global variable accessible across files? Explain the extern keyword?
State two uses of pointers in C?
Tell me what are bitwise shift operators?
Wt are the Buses in C Language
Why c is called object oriented language?