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

Explain what are the standard predefined macros?

1123


Give basis knowledge of web designing ...

2022


What is malloc and calloc?

1063


What is the difference between struct and union in C?

1321


C program to find all possible outcomes of a dice?

2365


When is a void pointer used?

1247


a formula,a series of steps,or well defined set of rules for solving a problem a) algorithem b) program c) erdiagram d) compiler

1084


What is the function of multilevel pointer in c?

1088


Explain the use of #pragma exit?

1181


What are comments and how do you insert it in a C program?

1255


What is the general form of a C program?

1031


What is a stream water?

1229


which of the following is not a character constant a) 'thank you' b) 'enter values of p, n ,r' c) '23.56E-o3' d) all of the above

2067


Write a code on reverse string and its complexity.

1042


using for loop sum 2 number of any 4 digit number in c language

2351