In this function
int ispisi_broj(int a) {
cout << " Input number: ";
cin >> a;
cout << a;
return 0;
}
the value of the parameter a is not used because it is at once reassigned in this statement
cin >> a;
So the function declaration does not make a great sense.
Also the return type int
of the function also does not make a sense.
It seems you mean the following
#include <iostream>
using namespace std;
void ispisi_broj( int &a )
{
cout << " Input number: ";
cin >> a;
}
int main()
{
int number;
ispisi_broj(number);
cout << " Input number: ";
cout << a << '\n';
return 0;
}
That is if you want to change the variable number
declared in main within the function ispisi_broj
then you need to pass it to the function by reference.