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

#include<stdio.h>
#include<conio.h>
int main()
{
int num,i=1,j,k;
printf("\n\tEnter the number:");
scanf("%d",&num);
while(i<=num)
{
k=0;
if(num%i==0)
{
j=1;
while(j<=i)
{
if(i%j==0)
k++;
}
j++;
if(k==2)
printf("\n\t%d is a Prime factor:"i);
}
i++;
}
return 0;
}

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

swap 2 numbers without using third variable?

1177


What does the message "automatic aggregate intialization is an ansi feature" mean?

1248


Is c# a good language?

1063


What is putchar() function?

1224


What is header file in c?

1114


how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.

1741


Explain what are binary trees?

1137


What is structure data type in c?

1069


What is the difference between NULL and NUL?

1357


What is the difference between int main and void main in c?

1241


How do we make a global variable accessible across files? Explain the extern keyword?

1941


State two uses of pointers in C?

1111


Tell me what are bitwise shift operators?

1178


Wt are the Buses in C Language

3267


Why c is called object oriented language?

1118