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 / rajesh kumar s

int main()
{
int n,num,i;
printf("enter the num");
scanf("%d",&num);
n=num;
printf("\n");
for(i=2;i<=n/2;i++)
{
if(n%i==0)
{
prime(i);
}
}
}

void prime(int x)
{
int i,f=0;
for(i=2;i<=x/2;i++)
{
if(x%i==0)
{
f=1;
break;
}
}
if(f==0)
printf(" %d",x);

}

Is This Answer Correct ?    49 Yes 40 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program to check whether a number is prime or not using c?

1068


What is structure in c language?

1181


What is the function of multilevel pointer in c?

1095


i have a written test for microland please give me test pattern

2739


What does main () mean in c?

1106


A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor

1108


What is the difference between array_name and &array_name?

1310


What are the data types present in c?

1173


How can a program be made to print the name of a source file where an error occurs?

1233


Explain which function in c can be used to append a string to another string?

1096


Are global variables static in c?

1178


How can I make it pause before closing the program output window?

1048


1. Write a function to display the sum of two numbers in the following ways: By using (i) pass by value (ii) pass by address a. function with argument and with return value b. function with argument and without return value c. without argument , with return value d. without argument , without return value Note: Use pass by address.

2821


What is the default value of local and global variables in c?

1051


Where can I get an ansi-compatible lint?

1157