Here is the code for finding a prime number in a specified range.

Code: C
#include <stdio.h>
#include <math.h>
// The range of numbers where you want to look for prime numbers
#define RANGE_MIN 2
#define RANGE_MAX 100

void main(void)
{
    int i,j,sq,is_prime;

    for(i=RANGE_MIN;i<=RANGE_MAX;i++)
    {

        is_prime = 1;
        sq = sqrt(i); // calculate the square root
        for(j=2;j<=sq;j++)
        {
            if(i%j==0)
                is_prime = 0;
        }

        if(is_prime)
            printf("%d, ",i);
    }
}

Also checkout this thread http://www.go4expert.com/showthread.php?t=2049