0
The problem is this, I have to receive an integer value and calculate the factorial of this number (until then quiet), and take and print on the screen the prime numbers that exist between one and the factorial, but I’m having problems to do this, someone can tell me what is wrong?
/*Mostrar todos os numeros primos*/
# include<stdio.h>
# include<stdlib.h>
int main()
{
long int numero,fatorial=1;
int cont,contador=1,teste,truvs,bash=0,primo;
scanf("%ld",&numero);
for(cont=1;cont<=numero;cont++)
{
fatorial*=cont;
}
printf("FATORIAL -> %ld\n",fatorial);//só printei pra testar a fatoração
//---------DELIMITA A OPERAÇAO---------
for(contador=2;contador<=fatorial;contador++)
{
bash=0;
//--------TESTA PRIMO------------
for(teste=1;teste<=contador;teste++)
{
bash=0;
//---------ISOLAR O TESTE DE DIVISAO-----------
while(bash<2)
{
// truvs=contador%teste;
if(contador%teste==0)
{
bash++;
printf("%d\n",bash);
}
else
{
break;
}
}
if(bash==2)
{
printf("%d\n",contador);
}
// bash=0;
}
}
return 0;
} //Fim do programa