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 / priyanka chauhan

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,n;
clrscr();
printf("Enter the no: ");
scanf("%d",&n);
for(j=2;j<=n;j++)
{
if(n%j==0)
{
for(i=2;i<=j-1;i++)
{
if(j%i==0)
break;
}
if(i==j)
printf("%d ",j);
}
}
getch();
}

Is This Answer Correct ?    23 Yes 18 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How would you obtain the current time and difference between two times?

1333


What is %lu in c?

1326


What is scanf_s in c?

1166


How do you sort filenames in a directory?

1231


Explain how can I right-justify a string?

1091


What is a char c?

1085


Explain the term printf() and scanf() used in c language?

1092


Write a code of a general series where the next element is the sum of last k terms.

1092


What is the acronym for ansi?

1105


Explain the meaning of keyword 'extern' in a function declaration.

1203


Why c is called a middle level language?

1157


What is double pointer?

1039


When was c language developed?

1256


Write programs for String Reversal & Palindrome check

1133


What is the use of getchar() function?

1178