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
Where is volatile variable stored?
Explain what are header files and explain what are its uses in c programming?
i have a written test for microland please give me test pattern
C program to find all possible outcomes of a dice?
How can I remove the leading spaces from a string?
How can you read a directory in a C program?
Describe the modifier in c?
Write a program to know whether the input number is an armstrong number.
In which header file is the null macro defined?
What are preprocessor directives in c?
GIven a sequence of characters. How will you convert the lower case characters to upper case characters. ( Try using bit vector - sol given in the C lib -> typec.h)
What are disadvantages of C language.
What is double pointer in c?
What is else if ladder?
write a C program:There is a mobile keypad with numbers 0-9 and alphabets on it. Take input 0f 7 keys and then form a word from the alphabets present on the keys.