It is taking forever to give the answer,it seems like it is just processing the answer? I have seen similar questions but please tell me what is wrong with this code?
#include<stdio.h>
main()
{
int flag=0;
unsigned long long int j,z,ino,i;
scanf("%llu",&ino);
for(i=2;i<=ino/2;i++)
{
flag=0;
if(ino%i==0)
{
for(j=2;j<=i/2;j++)
{
if(i%j==0)
{
flag=1;
}
}
if(flag==0)
{
z=i;
}
}
}
printf("%llu",z);
}
Here's the problem:
The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ?