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 / sourav das

#include<stdio.h>
#include<conio.h>

void main()
{
int i,j,k,l,n;
clrscr();
printf("Enter The Number:");
scanf("%d",&n);
i=1;
while(i<=n)
{
if(n%i==0)
{
j=1;
k=0;
l=1;
while(l<=j)
{
if(j%l==0)
k++;
l++;
}
if(k==2)
{
printf("\n%d is the prime factor of %d",l-1,n);
}
}
i++;
}
getch();
}

Is This Answer Correct ?    26 Yes 24 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many parameters should a function have?

1200


How can I generate floating-point random numbers?

1134


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

1059


What are the advantages and disadvantages of a heap?

1218


Explain what is the difference between a free-standing and a hosted environment?

1189


formula to convert 2500mmh2o into m3/hr

1000


What is a void pointer in c?

1114


Explain how are 16- and 32-bit numbers stored?

1275


What do header files do?

1084


What is the scope of local variable in c?

1137


Explain the array representation of a binary tree in C.

1237


What is local and global variable in c?

1210


write a program to find the given number is prime or not

4774


Is it valid to address one element beyond the end of an array?

1176


Difference between goto, long jmp() and setjmp()?

1182