I would re write your function like this
string backwards(string input)
{
string temp;
for (size_t i = input.size() - 1; i >= 0; i--)
temp += input[i];
return temp;
}
// then in you main function
cout<<"Input backwards is : " << backwards(input);
FYI size_t is the type returned by the size() function. It is normally an unsigned int.