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 / courage

#include<stdio.h>

int main()

{

int num=0;

printf("Enter number\n");

scanf("%d",&num);

int i,count=0,j;

for (i=1;i<=num;i++)

{

if (num%i==0)

{

for (j=1;j<=i;j++)

{

if(i%j==0)

{

count=count+1;

}

}

if (count==2)

{

printf("%d",i);

}

count=0;




}

}

}

Is This Answer Correct ?    4 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is c method?

993


Are enumerations really portable?

1020


What is the use of header?

1086


What are the primitive data types in c?

1070


a program that performs some preliminary processing in C, it acts upon certain directives that will affect how the compiler does its work a) compiler b) loader c) directive d) preprocessor

1083


Does * p ++ increment p or what it points to?

1117


Explain what is a program flowchart and explain how does it help in writing a program?

1093


Explain how do you use a pointer to a function?

1103


Why is a semicolon (;) put at the end of every program statement?

1068


What are the different types of endless loops?

1071


What is restrict keyword in c?

1103


What is a stream water?

1207


What are the types of functions in c?

976


What is the scope of local variable in c?

1120


How is a structure member accessed?

1125