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 is c method?
Are enumerations really portable?
What is the use of header?
What are the primitive data types in c?
a program that performs some preliminary processing in C, it acts upon certain directives that will affect how the compiler does its work a) compiler b) loader c) directive d) preprocessor
Does * p ++ increment p or what it points to?
Explain what is a program flowchart and explain how does it help in writing a program?
Explain how do you use a pointer to a function?
Why is a semicolon (;) put at the end of every program statement?
What are the different types of endless loops?
What is restrict keyword in c?
What is a stream water?
What are the types of functions in c?
What is the scope of local variable in c?
How is a structure member accessed?