Advertisement
adventuretimeh

num minimo N2

Feb 11th, 2020
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.56 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. /* run this program using the console pauser or add your own getch, system("pause") or input loop */
  5.  
  6. int main(int argc, char *argv[]) {
  7.     int num,min,conta,N;
  8.     do{
  9.         printf("di quanti num vuoi elaborare per il calcolo min");
  10.         scanf("%d",&N);
  11.     }while(N<=0);
  12.     printf("dammi un numero");
  13.     scanf("%d",&num);
  14.     min=num;
  15.     conta=1;
  16.     while(conta<N)
  17.     {
  18.         printf("dammi un numero");
  19.             scanf("%d",&num);
  20.             if(num<min)
  21.             {
  22.                 min=num;
  23.             }
  24.             conta=conta+1;
  25.     }
  26.     printf("il valore minimo vale : %d",min);
  27.    
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement