I've been trying to figure out what's wrong with my code. I used printf so I could confirm whether or not the value of N is correct but it's coming out as completely different as what I would expect it to. Please tell me what I'm doing wrong so I can fix it.
#include <cs50.h>
#include <stdio.h>
int main(void)
{
// Prompt user to input card number
long cardNumber, N;
int v = 0, d;
do
{
cardNumber = get_long("Card Number: ");
}
while ((cardNumber < (1e12)) || (cardNumber > (1e16)));
// Calculate sum of digits non-underlined digits
N = cardNumber;
while (v < 16)
{
N = N / 10^v;
d = N % 10;
v += 2;
}
printf("%li", N);
}