1 / 2
Sep 2019

#include <stdio.h>
void prime(int m,int n)
{ int i,j,f;
for(i=m;i<=n;i++)
{ f=0;
for(j=2;j<n;j++)
{
if((i%j==0)&&(j!=i))
{
f=1;
}
}
if(f!=1)
{

	   printf("%d\n",i);
    }
}

}

int main(void) {
int t,m,n;
scanf("%d",&t);
scanf("%d %d",&m,&n);
while(t>0)
{
prime(m,n);
t–;
}

return 0;

}

  • created

    Sep '19
  • last reply

    Sep '19
  • 1

    reply

  • 538

    views

  • 2

    users

  • 2

    links

Suggested Topics

Topic Category Replies Views Activity
Online Judge System 1 147 Mar 23

Want to read more? Browse other topics in Online Judge System or view latest topics.