Write a program to generate prime factors of a given integer?
Answer Posted / courage
#include<stdio.h>
int main()
{
int num=0;
printf("Enter number\n");
scanf("%d",&num);
int i,count=0,j;
for (i=1;i<=num;i++)
{
if (num%i==0)
{
for (j=1;j<=i;j++)
{
if(i%j==0)
{
count=count+1;
}
}
if (count==2)
{
printf("%d",i);
}
count=0;
}
}
}
| Is This Answer Correct ? | 4 Yes | 16 No |
Post New Answer View All Answers
What are qualifiers and modifiers c?
What is the use of function overloading in C?
What is 2 d array in c?
WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?
What is the newline escape sequence?
Why is c called a mid-level programming language?
How can I copy just a portion of a string?
What is getche() function?
What does a function declared as pascal do differently?
How do I use void main?
What is c token?
What are pointers really good for, anyway?
Not all reserved words are written in lowercase. TRUE or FALSE?
What is variable in c example?
Write a program of prime number using recursion.