Advertisement
kamandos

HomeWork1

Jul 13th, 2022
706
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.38 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main(){
  4.  int arr[10],max,min;
  5.  printf("Enter the 10 numbers for checing: ");
  6.  for(int i=0;i<10;i++){
  7.     scanf("%d",&arr[i]);
  8.  }
  9.  
  10.  max=arr[0];
  11.  min=arr[0];
  12.  for(int j=0;j<10;j++){
  13.      
  14.     if(arr[j]>=max){
  15.         max=arr[j];
  16.     }
  17.    
  18.     if(arr[j]<=min){
  19.         min=arr[j];
  20.     }
  21.  }
  22.  
  23.  printf("Max:%d,Min:%d\n",max,min);
  24.  return 0;
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement