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

the constant value in the case label is followed by a a) semicolon b) colon c) braces d) none of the above

1247


What are integer variable, floating-point variable and character variable?

1243


What are lookup tables in c?

996


What are examples of structures?

1102


What is the c value paradox and how is it explained?

1050


What is the difference between array_name and &array_name?

1290


How can you read a directory in a C program?

1141


What do you mean by Recursion Function?

1118


Explain the advantages and disadvantages of macros.

1096


What is the use of gets and puts?

1026


Explain what is the purpose of "extern" keyword in a function declaration?

1067


What is a newline escape sequence?

1098


What are the 5 types of organizational structures?

1071


What is the right type to use for boolean values in c? Is there a standard type?

1007


What is extern storage class in c?

992