#include <iostream>
using namespace std;
void print_greeting(void);
short get_short(void);
short twice(short x);
void print_answer(short y);
int main(void)
{
short x, y;
print_greeting();
x = get_short();
y = twice(x);
print_answer(y);
return 0;
}
void print_greeting(void)
{
cout << "Welcome to our program!" << endl;
return; // note the return even though we
// have no output (function output,
// not console output)
}
short get_short(void)
{
short number; // local variable to store value
// user enters
cout << "Enter a small integer value: ";
cin >> number;
return number; // output number user entered
}
short twice(short x)
{
return 2 * x; // return twice our input as output
}
void print_answer(short y)
{
cout << "Your answer is: " << y << endl;
return; // again, return though we output nothing
}