Posted by: prankster February 5, 2011
Help Needed form C Programming experts
Login in to Rate this Post:     0       ?        
found an online compiler, dont know how long this link is valid
http://codepad.org/xNaHQtR5

This is what it returned me
ascii for A = 65


Link: http://codepad.org/xNaHQtR5    [ raw code | output | fork ] Save this paste 
Delete this paste

C, pasted 2 minutes ago: 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
int hash(char *name)
{
    int sum = 0;
    int i;
    for (i=0; i < strlen(name); i++)
    {
         sum  = sum + name[i];    
    }
    return sum;   
}

int main()
{
    int test = hash("AA");
    printf("%d", test);
    return 0;
}


Output:
1
130


happy coding..
Read Full Discussion Thread for this article