Skip to content

Instantly share code, notes, and snippets.

@whopiyush
Created December 4, 2018 08:19
Show Gist options
  • Select an option

  • Save whopiyush/ef75e4d5d2625996b9ab50d26a7ee73e to your computer and use it in GitHub Desktop.

Select an option

Save whopiyush/ef75e4d5d2625996b9ab50d26a7ee73e to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
int main(){
int a[5],max=0,min;
for(int i=0;i<5;i++){
cin >> a[i];
}
min = a[0];
for(int j=0;j<5;j++){
if(a[j] > max){
max = a[j];
}
}
for(int t=0;t<5;t++){
if(a[t] < min){
min = a[t];
}
}
cout << "Max: " << max << " Min: " << min;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment