You are trying to pass the integer you've already read, try:
std::cout << "Input a number: ";
int i = funkcija(std::cin);
std::cout << i << " ";
While this would work it seems strange. Consider separating the input- and output-handling from the calculation to improve your design. Change the function to:
int funkcija( int value ) {
if( value%2 == 0 ) {
return (value/2);
}
else return (value*3)+1;
}
and maybe call it like this:
std::cout << "Input a number: ";
int i;
if( !( std::cin >> i ) ) throw std::exception();
do {
i = funkcija( i );
std::cout << i << " ";
} while( i != 1 );