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

Do you know what are the properties of union in c?

999


What is string constants?

1097


Explain how can type-insensitive macros be created?

954


What is dynamic variable in c?

986


What is the equivalent code of the following statement in WHILE LOOP format?

1248


Did c have any year 2000 problems?

1062


Is c a great language, or what?

1050


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

1134


What is the modulus operator?

1152


Is there a built-in function in C that can be used for sorting data?

1180


how many types of operators are include in c language a) 4 b) 6 c) 8 d) 12

1017


printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions

1096


What is structure padding in c?

1058


What is #define in c?

991


What is the use of f in c?

934