[ create a new paste ] login | about

Link: http://codepad.org/rApPQmHA    [ raw code | fork ]

Saumya_Agnihotri - C, pasted on May 11:
#include<stdio.h>
#include<math.h>
int main()
{
    int i,j, num, c =0;
    long int a,b;
    scanf("%d",&num);
    while(num--)
    {   
        scanf("%d%d", &a,&b);
        if(a==1)a++;
        for(i=a;i<=b;i++)
        {   c=0;
            for(j=2;j<=sqrt(i);j++)
            {
                if(i%j==0)
                c = c+1;
            }
        if(c==0)
        printf("%ld\n",i);
            
        }
        
    }
    return 0;
}


Output:
No errors or program output.


Create a new paste based on this one


Comments: