These are the details. (https://i.stack.imgur.com/cMY9J.png)
#include <stdio.h>
#include <stdlib.h>
int maxdigit(char sir[]);
int main()
{
char s[100];
gets(s);
printf("The greatest digits is %i\n", maxdigit(s));
}
int maxdigit(char sir[])
{
int i, max = 0;
for(i=0;i<100;i++)
{
if(max<sir[i])
{
max = sir[i];
}
}
return max;
}
I genuinely don't know how to get only the integer values in a string to return it. How can i do it so it doesn't compare with the ascii codes of the letters?