about summary refs log tree commit diff
path: root/usth/ICT2.1/labwork/1/Ex1.cc
blob: da20f22791472aaed0012103376a08aab15461f8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Read two integers from stdin and print their sum and product
// This is free and unencumbered software released into the public domain.

#include <iostream>

using namespace std;

int
add (int& a, int& b)
{
  return a + b;
}

int
mul (int& a, int& b)
{
  return a * b;
}

int
main ()
{
  int a;
  int b;

  cin >> a >> b;
  cout << add (a, b) << endl << mul (a, b) << endl;
}