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 / neha

#include<stdio.h>
#include<conio.h>
int main()
{
int num,i=1,j,k;
printf("\n\tEnter the number:");
scanf("%d",&num);
while(i<=num)
{
k=0;
if(num%i==0)
{
j=1;
while(j<=i)
{
if(i%j==0)
k++;
}
j++;
if(k==2)
printf("\n\t%d is a Prime factor:"i);
}
i++;
}
return 0;
}

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are linker error?

1097


How to compare array with pointer in c?

1113


How can you invoke another program from within a C program?

1077


What are the different properties of variable number of arguments?

1166


general for is %wd,f-d; in this system "w" means a) 'w' represent total width of digits b) 'w' represent width which includes the digits before,after decimal place and the decimal point c) 'w' represent width which includes the digits before only d) 'w' represent width after decimal place only

1077


HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????

2698


write a program to generate address labels using structures?

4582


Is null valid for pointers to functions?

1179


Is c object oriented?

974


What is difference between stdio h and conio h?

1384


which is an algorithm for sorting in a growing Lexicographic order

1810


Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop

2162


When c language was developed?

1063


Explain what math functions are available for integers? For floating point?

1117


What is a lvalue

1087