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
Why do we need arrays in c?
What does %2f mean in c?
Explain how do I determine whether a character is numeric, alphabetic, and so on?
write a program to generate address labels using structures?
what is the basis for selection of arrays or pointers as data structure in a program
Explain the difference between malloc() and calloc() function?
#define PRINT(int) printf("int = %d ",int) main() {< BR> intx,y,z; x=03;y=02;z=01; PRINT(x^x); z<<=3;PRINT(x); y>>=3;PRINT(y); }
what is event driven software and what is procedural driven software?
Explain what are its uses in c programming?
How will you find a duplicate number in a array without negating the nos ?
number of times a digit is present in a number
Differentiate call by value and call by reference?
Subtract Two Number Without Using Subtraction Operator
Tell us the use of fflush() function in c language?
how to print the character with maximum occurence and print that number of occurence too in a string given ?