On line 7 you declare the function "x" as taking one parameter, but on line 13 you call the function with no parameter. The function definition and call do not match.
And if you call function "z" the value of "a" will be lost when the function ends. If you would need to use the value stored in "a" in function "z" you will need to do something different.
This should help you understand that functions "z" and "x" both return an int,, but neither function is returning anything. And i function "z" the value of "a" is lost when the function ends.
You should compile the program and try to fix any errors yo can and post the errors that you do not understand.
When I tried to compile the program here, the gear icon in the top right of the code box, I received warnings about functions "z" and "x" not returning a value.
Give the link a read and see if you can figure it out and we can go from there.
#include<iostream>
//using namespace std; // <--- Best not to use.
void z(int& a) // <--- Changed to void return type. Passed "a" by reference.
{
a = 1;
}
void x(int a) // <--- Changed to void return type.
{
std::cout << a << std::endl;
}
int main()
{
int a{ 10 };
x(a); // <--- Prints the first value of "a" defined in main.
z(a); // <--- Changes the value of "a" defined in main.
x(a); // <--- Prints the changed value of "a" defined in main.
return 0; // <--- Not needed, but good programming.
}