Question: You are given a string s 1 . You need to check whether a string contains only digits or not. If the string contains only
You are given a string s You need to check whether a string contains only digits or not. If the string contains only digits then the string operation returns YES, otherwise, retur The function IsDigit accepts the parameters string s Complete the function isDigit that returns the check digit in boolean format. Print whether YES or NO based on the
Example:
If the string s is then the string consists of only digits and hence the operation returns true. If the stringchecking operation returns true then print YES, otherwise
Constraints:
ssize
Example :
Input: sr
Output:
checkstring NO
Example :
Input:
$
Output:
Checkstring YES
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
