Write a recursive void function that has one parameter which is a positive integer. When called, the function is to write its arguments to the screen backward: If the argument is 1234, the output should be. 4321.
What will be an ideal response?
```
void backward(int n)
{
if(n<10)
cout << n;
else
{
cout << n%10; // write last digit
backward(n/10); // write rest of digits (backwards)
}
}
```
You might also like to view...
A mnemonic is:
A) A single key on the keyboard that you press to quickly access a component such as a button B) A key on the keyboard that you press in combination with the SHIFT key to quickly access a component such as a button C) A key on the keyboard that you press in combination with the ALT key to quickly access a component such as a button D) A key on the keyboard that you press in combination with the CTRL key to quickly access a component such as a button
Ajax is used to:
A) partition Web sites into different Web forms. B) obtain data from a Web server and update the current Web form. C) confirm credit card accounts using a secure transaction. D) transmit data to an external partner using XML documents.