0
Someone should please help me solve this...
Write a function named "digit_name" that takes an integer argument in the range from 1 to 9, inclusive,and prints the English name for that integer on the computer screen.if the argument is not in the required range,then the function should print "digit error"
2 ответов
+ 1
#include <iostream> // defines cout
using namespace std; // so we don't say std:: before cout and endl.
void digit_name(int digit)
{
if (digit == 1)
cout << "one";
else if (digit == 2)
cout << "two";
// fill this in for 3 - 8.
else if (digit == 9)
cout << "nine";
else
cout << "digit error";
}
0
Thanks very sir