Tuesday, January 22, 2019

Minimum of two integers


Write a program that reads two numbers and prints their minimum.

Input: Input consists of two integer numbers.

Output: Print a line with the minimum of the two numbers.

Solution :


#include <iostream>
using namespace std;

int main() {
    int n,m;
    cin >> n >> m;
    if (n < m) cout << n << endl;
    else cout << m << endl;
}

No comments:

Post a Comment

Modelo OSI

Open System Interconnection , Interconexión de Sistemas Abiertos, es un modelo para estudiar las categorías en que se pueden dividir los pr...