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
|
#include <iostream>
using namespace std;
void function1(int &, int &);
int function2(int &);
int function3(int , int);
void function4(int, int, int);
void main()
{
int x = 9, y = 7, z = 5;
for(int i = 0; i<= 5; i++)
function1(x, y);;
z = function2 ( y );
if((z>=10 && x<7) || y!= 5)
{
y = function3(x,9);
x = function3(y,9);
}
else
z = function3(z,x);
function4(x, y, z);
system("pause");
}
void function1(int &a, int &b)
{
a++;
b--;
if(a == b)
a = 2*b;
else
b = a%2;
}
int function2( int & a )
{
a+=2;
return 10;
}
int function3(int a, int b)
{
return a*2+b/2;
}
void function4(int a, int b, int c)
{
cout << "The Result is: " << (a+b)/c << endl;
}
|