⚠️AdBlock Detected

It looks like you're using an ad-blocker!

😭Our team work realy hard to produce quality content on this website and we noticed you have ad-blocking enabled.

ziontutorial.com 👽

Tech That Matters

How To

C++ Algorithm minmax()

Hi, here we will learn how to find minimax () by using the function. below i have written a function to find out which array element is maximum and which value is minimum and which is maximum.

find Maximum and minimum number in C++
using namespace std;
#include <climits>

int getMax(int num[],int n) {
    int max = INT_MIN;
    for(int i = 0; i<n; i++) {
            max = num[i];

    return max;

int getMin (int num[],int n){
    int min = INT_MAX;
    for(int i = 0; i<n; i++){
        if(num[i] > min)

int main() {

    int size;
    cin >> size;
    int num[100];
    //taking input in array
    for ( int i = 0; i<size; i++)

    cout << " Maximum value is"<< getMax(num,size)<<endl;
    cout << " Minmum value is"<< getMin(num,size)<<endl;
    return 0;

See also  ? How to Speed Up Your Windows 10 Performance with - SCleaner