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

What are register variables in c?

973


Why c is called procedure oriented language?

995


what will be the output for the following main() { printf("hi" "hello"); }

10784


Can we initialize extern variable in c?

1073


What is n in c?

969


How can this be legal c?

1042


can we change the default calling convention in c if yes than how.........?

2467


Is c compiled or interpreted?

1127


What is a newline escape sequence?

1051


What are near, far and huge pointers?

1012


What is a file descriptor in c?

1052


what is a function method?give example?

2309


What are local static variables? How can you use them?

1079


Declare the structure which contains the following members and write in C list of all students who score more than 75 marks. Roll No, Name, Father Name, Age, City, Marks.

1255


What is a example of a variable?

946