I don't know where the problem lies. The code compiles without any error, but while running it, it asks me for a number but when I hit enter after giving an input it crashes. Can anybody tell me where the problem lies? I think there is some memory problems but I can't figure out where. Thanks in advance.
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int n[16];
long long a;
printf("enter your credit card number \n");
scanf(" %lld", &a);
int i;
for ( i = 0; i < 15; i++)
{
n[i] = (a % (10^(15-i))) / 10^(14-i);
}
int m = (n[1] + n[3] + n[5] + n[7] + n[9] + n[11] + n[13]);
int w = 2 * m;
int k = w % 10;
int l = n[0] + n[2] + n[4] + n[6] + n[8] + n[10] + n[12] + n[14];
int z = k + l;
if (z % 10 == 0)
{
printf("you card is valid");
}
else
{
printf("go get a new card");
}
return 0;
}