When I compile the same program to another platform it works perfectly. even in np ARM9.
Can anyone help me solve this?
Code: Select all
#include <stdio.h>
#include <stdlib.h>
unsigned char teste(int numero)
{
unsigned int metade=0;
unsigned int cont=2;
metade = (numero/2)+1;
for(cont=2;cont <= metade; cont++)
{
if (numero%cont==0)
{
return 0;
break;
}
}
return 10;
}
int main (int argc,char *argv[]){
unsigned int cont1=5,numPri,inicio;
sscanf(argv[1],"%d",&numPri);
sscanf(argv[2],"%d",&inicio);
printf("calma");
for(cont1=0;cont1 < numPri;)
{
if (teste(inicio))
{
printf("O numero %u\n",inicio);
cont1++;
}
inicio++;
}
}