Programs Collections

 Write a macro to find smallest from two given numbers.

#include <iostream>

using namespace std;

#define MIN(x,y) (x<y?x:y)

int main() {

    int x = 10, y =12, z = 34;

    cout<<"Min ="<<MIN(x,MIN(y,z));

    return 0;

}

Comments

Popular posts from this blog

Important Program Collection

[16 Feb 2020] Given an array where every element occurs three times, except one element which occurs only once.

Which data structure is used in redo-undo feature?