#include <iostream>

using namespace std;

int foreign(int x);
int x;

int main()
{

x=10;
 

int i, j;

i = 2 * x;

if (i > 10)
j = x / 2;

return j - 1;

cout << foreign(x) << endl;
}
... 

int foreign(int x)
{
int i, j;

i = 2 * x;

if (i > 10)
j = x / 2;

return j - 1;
}


int main(/*..*/)
{
int x=10;
cout << foreign(x) << endl;
return 0;
}

Can you please ask a specific question rather than just posting code? And also in the response - what seems to be added was the foreign() definition?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.