Programming Problem 03
//Thank you BLUEPIXY for the tip (long long int num=600851475143LL)
//The prime factors of 13195 are 5, 7, 13 and 29.
//What is the largest prime factor of the number 600851475143 ?
//So, yea.. Here's my answer! Finally!
#include<stdio.h> #include<conio.h> main() { long long int num=600851475143LL; long factor=0,x,y; for(x=1;x<num;x++) { for(y=1;y<x;y++) { if(x%y==0) factor++; } if(factor<=2) { if(num%x==0) printf("%ld ",x); } factor=0; }
/*TheJanellenaj*/
getch(); }














