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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
void GetProduct ( int A, int B, int & Product );
int printEvenAscending ( int num1, int num2);
int print5Rand (int number3, int number88, int output);
int main()
{
int First, Second, PROD;
cout << "Input two integers";
cin >> First >> Second;
GetProduct( First, Second, PROD );
cout << PROD << endl;
system("pause");
return 0;
}
void GetProduct ( int A, int B, int & Product )
{
Product = A * B;
return;
}
int printEvenAscending (int num1, int num2)
{
cout << "Input two numbers";
cin >> num1 >> num2;
int i;
for(i = num1; i < num2; i++)
{
if(i % 2 == 0)
{
cout << i <<" ";
}
}
return 0;
}
int print5Rand (int number3, int number88, int output)
{
int number3, number88, output;
number3 = 3;
number88 = 88;
srand(time(NULL));
for (int i = 0; i < 5; i++) {
output = rand()%((number3 - number88) + 1);
cout << output << " ";
return 0;
}
|