Your text documents various C++ functions in Appendix F. Refer to the functions contained in the cctype (ctype.h) library. Identify a function that will determine if a char input is a digit (‘0’ to ‘9’). Indicate how many pieces of data must be passed to the function. Indicate, what (if anything) will be returned by the function. Demonstrate the appropriate use of the function in a short code fragment.
`Hey,
Note: Brother if you have any queries related the answer please do comment. I would be very happy to resolve all your queries.
isdigit(char) is the function to know if the character is a digit or not. It returns true if character is digit otherwise it will return a bool false. The parameter passed is a character.
Code fragment is
#include <iostream>
#include<cctype>
using namespace std;
int main()
{
char c='7';
if(isdigit(c))
{
cout<<c<<" is a digit\n";
}
else
{
cout<<c<<" is not a digit\n";
}
return 0;
}
Kindly revert for any queries
Thanks.
Get Answers For Free
Most questions answered within 1 hours.