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 are examples of structures?

1026


What is a string?

1052


given post order,in order construct the corresponding binary tree

2724


What is volatile, register definition in C

1057


What is the use of linkage in c language?

1010


Differentiate between the expression “++a” and “a++”?

1203


What is the full form of getch?

1181


Can you pass an entire structure to functions?

1078


how to introdu5ce my self in serco

1938


What are the functions to open and close file in c language?

1130


What are the rules for the identifier?

1114


What is scope rule of function in c?

1029


what will be the output for the following main() { printf("hi" "hello"); }

10798


How can I recover the file name given an open stream or file descriptor?

1030


Explain the difference between malloc() and calloc() function?

987