Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main(int argc, char *argv[])
- {
- int numero;
- do{
- system ("cls");
- printf ("Inserisci un numero maggiore di 1\n");
- scanf ("%d",&numero);
- if (numero< 2) {printf ("\nErrore nei dati\n");system ("PAUSE");}
- }while (numero<2);
- primo(numero);
- printf ("\n");
- system("PAUSE");
- return 0;
- }
- int primo (int a,int b,int c){
- b=a;
- do{
- if (a%b==0) {printf ("\nE' divisibile per %d\n",b);c=b;}
- b--;
- }while(b>1);
- if (c==a){printf ("\nNUMERO PRIMO\n");}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement