Final answer:
To check if every character in a string is a digit, you can use the isdigit() function in most programming languages.
Step-by-step explanation:
To write a program that checks if every character in a string is a digit, you can use the isdigit() function in most programming languages. Here's an example in Python:
def check_digits(string):
for char in string:
if not char.isdigit():
return 'no'
return 'yes'
input_string = input('Enter a string: ')
result = check_digits(input_string)
print(result)
In this program, we define a function check_digits() that iterates over each character in the string. If any character is not a digit, it immediately returns 'no'. Otherwise, it returns 'yes' at the end. You can test the program with different input strings to see the output.