Question: I need help writing a C program to validate credit card numbers. I have the directions posted below. And the code I have so far.

I need help writing a C program to validate credit card numbers. I have the directions posted below. And the code I have so far. The replies I have gotten so far have been very confusing to me. Here is a picture showing an example of having the numbers looped through.

I need help writing a C program to validate credit card numbers.

I have the directions posted below. And the code I have so

Code:

#include

#include

#include

int stripper(long long longNumber, int digitNumber) {

return ((longNumber - ((long long)(longNumber / pow(10, digitNumber))*pow(10, digitNumber))) / pow(10, digitNumber - 1));

}

int isOdd(long int digit)

{

if (digit % 2 == 0)

return 0;

else

return 1;

}

int main()

{

printf("Please enter credit card number");

scanf_s();

long long testNumber = 5120415296389632; //long long is a data type for a large integer

getchar();

return 0;

}

Account number Double every odd digit Sum 5 1 2 0415 29 63 8 96 3 2 10 1408 1 10 2 1866 8 186 6 2 1 140 81 12 9668 9662 70

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!