All pastes #1070146 Raw Edit

Someone

public c v1 · immutable
#1070146 ·published 2008-07-12 16:30 UTC
rendered paste body
#include <stdio.h>#include <stdlib.h>#include <string.h>int main(int argc, char *argv[]){    int length;    length = strlen(argv[1]);    int i;    int digit;    int c;    c = 0;    for (i=0; i<length; i++)    {        digit = argv[1][i] - '0';        if (digit != 0)        {            c += digit;            if (c > 10)            {                c -= 9;            }        }    }    printf("Checksum is: %d\n", c);    return(0);}