daily pastebin goal
65%
SHARE
TWEET

Untitled

a guest Mar 13th, 2018 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. int main()
  3. {
  4.     int array[20], minimo,num, i;
  5.  
  6.     printf("Quanti numeri vuoi inserire?\n");
  7.     scanf("%d",&num);
  8.    
  9.     printf("Inserisci i valori: ");
  10.     for ( i = 0 ; i < num ; i++ )
  11.         if(array[i]>0)
  12.         {
  13.         scanf("%d", &array[i]);
  14.         minimo = array[0];
  15.         }
  16.         else
  17.             printf("Hai inserito un numero inferiore a 0 o un carattere!");
  18.     for ( i = 1 ; i < num ; i++ )
  19.     {
  20.         if ( array[i] < minimo )
  21.         {
  22.            minimo = array[i];
  23.        
  24.         }
  25.     }
  26.     printf("Il minore e' %d",  minimo);
  27.     return 0;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top