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

Is c object oriented?

961


What is bash c?

1008


What is the role of && operator in a program code?

1061


How can you avoid including a header more than once?

980


what is the difference between class and unio?

2360


What is a program flowchart?

1190


"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above

1011


Explain output of printf("Hello World"-'A'+'B'); ?

1488


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

2147


What is pointer to pointer in c with example?

1061


What is the difference between malloc() and calloc()?

1832


Why C language is a procedural language?

1019


Explain what is #line used for?

1061


How can you increase the allowable number of simultaneously open files?

1147


What is pointer & why it is used?

1109