Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / ruchi

#include<stdio.h>
#include<conio.h>
int main()
{
int num,i,f=0,k=0,d,m;
printf("\n Enter the number ");
scanf("%d",&num);
m=num;
while(k<=m)
{
k=k+1;
f=0;
d=num%k;
if(d==0)
{
i=2;
while(i<=k-1)
{
if(k%i==0)
{
break;
}
i++;
}
if(i==k)
{
printf("\nPrime Factor %d ",k);
}
}
}
getch();
}

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is assert and when would I use it?

1000


When should the volatile modifier be used?

1170


What is exit() function?

1012


What Is The Difference Between Null And Void Pointer?

1245


what is uses of .net

1729


Explain how do you print only part of a string?

1212


how to make a scientific calculater ?

2067


What is operator promotion?

1058


What are structure members?

1090


Why array is used in c?

1012


What does the error 'Null Pointer Assignment' mean and what causes this error?

1215


Can we declare variable anywhere in c?

967


will u please send me the placement papers to my mail???????????????????

1834


praagnovation

2277


Write a program of advanced Fibonacci series.

1145