[ create a new paste ] login | about

Link: http://codepad.org/qbxJtoUz    [ raw code | output | fork ]

C, pasted on Aug 31:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <stdio.h>
char sc(char *str);
int main()
{
    printf("%c",sc("sdkfjhskfnsddr"));
    getchar();
    return 0;    
}
char sc(char *str)
{
    char max='a'; int i;
    for(i=0;i<sizeof(*str)/2;i++)
    {
                                    if(str[i]>max)max=str[i];                            
    }
    return max;
}


Output:
1
a


Create a new paste based on this one


Comments: