1. ## Need Help

Hi I need help starting this program
The program check to see if a credit card is valid or not
the number is 16 digits long
EX: Card Number 1234567890123456
Code:
```1. Double the value of alternating digits of the credit card number
1  2   3   4    5   6   7    8   9    0   1   2    3   4     5   6
x2       x2       x2       x2        x2      x2       x2       x2
--------------------------------------------------------------------
1  4   3   8    5   12   7  16  9   0   1   4    3    8    5   12

1 + 4 + 3 + 8 + 5 + 12 + 7 + 16 + 9 + 0 + 1 + 4 + 3 + 8 + 5 + 12 =98

3. Divide the sum by 10
98/10=9.8```
If the number is evenly divisible then it is valid
If it is not evenly divisible than it is invalud

thanks for the Help Joe

2. Post some code attempts and we'll be glad to help.

3. I want to enter it in as a string then convert it to a integer but how do I do that

4. Traverse the string, then add every element in it to the total sum. Note that '0' == 48, '1' == 49, '2' == 50, etc...
Code:
```#define FirstDigit 48

int SumNumbersInString(char* String)
{
int Sum = 0;
if(String != NULL)
{
for(int i=0; i<strlen(String); i++)
{
Sum += (String[i] - FirstDigit);
}
}
return Sum;
}```

5. Do you mean a char * or an ansi string?

6. Never mind

Magos did the char * way in case you're wondering.