courage


{ City } kasoa
< Country > other
* Profession *
User No # 48550
Total Questions Posted # 0
Total Answers Posted # 1

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 4
Users Marked my Answers as Wrong # 16
Questions / { courage }
Questions Answers Category Views Company eMail




Answers / { courage }

Question { Microsoft, 30684 }

Write a program to generate prime factors of a given integer?


Answer

#include

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