Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int N,K,i,m=0;
- printf("Entrez un nombre N pour afficher les nombres premier inferieur a ce nombre :");
- scanf("%d",&N);
- do{
- K=N-1;
- printf("les nombres premier inferieur a %d sont :\n",N);
- for(K=N-1;K>0;K--)
- {
- for(i=1,m=0;i<=K;i++)
- {
- if(K%i==0) m++;
- }
- if(K>2)
- {if(m==2) printf("%d \n",K);}
- }
- }while(K>=1);
- }
Advertisement
Add Comment
Please, Sign In to add comment