Advertisement
Guest User

bonu e

a guest
Dec 9th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6. int numero;
  7. do{
  8. system ("cls");
  9. printf ("Inserisci un numero maggiore di 1\n");
  10. scanf ("%d",&numero);
  11. if (numero< 2) {printf ("\nErrore nei dati\n");system ("PAUSE");}
  12. }while (numero<2);
  13. primo(numero);
  14. printf ("\n");
  15. system("PAUSE");
  16. return 0;
  17. }
  18. int primo (int a,int b,int c){
  19. b=a;
  20. do{
  21. if (a%b==0) {printf ("\nE' divisibile per %d\n",b);c=b;}
  22. b--;
  23. }while(b>1);
  24. if (c==a){printf ("\nNUMERO PRIMO\n");}
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement