Igor2909

es23pag69

Feb 12th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4.  
  5.  
  6. int main() {
  7.    
  8.     int N , n, mag , min;
  9.     printf("Quanti numeri ? ");
  10.     scanf("%d",&N);
  11.     while (N>0)
  12.     {
  13.         printf("Inserisci un numero: ");
  14.         scanf("%d", &n);
  15.    
  16.         if(n>mag){
  17.             mag =n;
  18.         } else if (n<min){
  19.             min = n;
  20.         }
  21.        
  22.         N--;
  23.     }
  24.     printf("Numero minore : %d", min);
  25.     printf("Numero maggiore : %d", mag);
  26.    
  27.     system("PAUSE");
  28. }
Advertisement
Add Comment
Please, Sign In to add comment