Advertisement
Guest User

2891 find the minimum number

a guest
Oct 16th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.34 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int  main() {
  4.  
  5.  int i,p,q;
  6.  int min = -100000;
  7.  
  8.    printf("Number of input :\n");
  9.    scanf("%d",&p);
  10.  
  11.     for(i=1;i<=p;i++){
  12.  
  13.     printf("Enter value %d:\n",i);
  14.     scanf("%d",&q);
  15.     if (i==1) min = q;
  16.  
  17.     if ( q< min)
  18.     {
  19.         min = q;
  20.     }
  21.  }
  22.  printf ("min value = %d\n",min);
  23.  
  24.  return 0;
  25.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement