Here 600851475143
is too big to hold for int
data type.
Use long long
instead of int
.So,change the following lines in your code to this:
long long n, a, b;
scanf( "%lld", &n );
printf("here is the largest prime number => %lld\n", a);
Checkout the link for details : Range of values in C Int and Long 32 - 64 bits