Ho risolto ma ho il problema che me lo chiede all'infinito mentre dovrebbe chiederlo un numero t di volte....sembra non diminuisca xchè?
int t,m,n,c;
int main(){ scanf("%d",&t);
            while(0<t<11){
            scanf("%d",&m);
            scanf("%d",&n);
            while(m<=n){
                        for ( c = 2 ; c <= m - 1 ; c++ ){
                                                         if ( m%c == 0 )
                                                         break;
                                                         }
                                                        if ( c == m ){printf("%d\n",m);}
                                                        m++;
                       }t--; 
           } 
            fflush(stdin);
            getchar();
            return 0;                  
            }