Prime Factor In C Program Tamil


// 24 prime factors 2,2,2,3
#include<stdio.h>
#include<conio.h>
void prime(int);
void main()
{
	int num;
	clrscr();	// clears the output screen
	printf("\n Enter the Number :");
	scanf("%d",&num);
	prime(num);
	getch();
}
void prime(int num)
{
	int i=2;
	printf("\n Prime Factors of %d are :",num);
	while(num!=1)
	{
		if(num%i==0)
		{
			printf("%d\t",i);
		}
		else
		{
			i++;
			continue;
		}
		num=num/i;
	}
}

Login To Download Source Code

Leave a Comment:

Login To Comment

List Of Programs


Goto Examples

Operators

Looping

Number Conversion

Pattern Design

Arrays

Matrix Examples

Sorting Examples

String Function

Change Case

String In C

Maths Functions

User Defined Functions

Recursive Functions

Pointer

Structure

File Concept

Calender Programming