Euler Problem 3: Largest prime factor : C Programming Solution

Problem :

The prime factors of 13195 are 5, 7, 13 and 29.

What is the largest prime factor of the number 600851475143 ?

Solution Approach :

Simple approach would be to identify all the prime numbers under the square root of the number 600851475143 which divide the the number 600851475143. When you find a prime factor using this method, keep the track of largest such number to get our result.

Solution :

Answer: 6857
Let me know your approach you happen to find a better way to solve this using C programming in the comment section below.
Happy coding !

Jeswin Augustine

I 'm a computer science graduate from Karunya University and I 'm a developer/designer. Born and brought up in India, I have worked with clients all around the globe.This blog serves as an informal and unorganized repository of things I ’ve worked on in my free time. It is mostly about programming for the web and sometimes for desktop application.

Leave a Reply

Your email address will not be published. Required fields are marked *