Function for the difference of two integers X51086


Statement
 

pdf   zip   main.cc

Write a function

    int dif(int x, int y);

which returns the difference betwen xx and yy.

Input

The input is formed by two integers.

Precondition

It holds 0<0 < @x@, @y@ <109< 10^9.

Observation

You only need to submit the required procedure; your main program will be ignored.

Public test cases
  • Input/Output

    dif(634, 371) → 263
  • Input/Output

    dif(-31, -21) → -10
  • Input/Output

    dif(-23, 23) → -46
  • Information
    Author
    Maria Serna
    Language
    English
    Translator
    Maria Serna
    Original language
    Catalan
    Other languages
    Catalan Spanish
    Official solutions
    Unknown.
    User solutions
    C++