#include <cs50.h>
#include <stdio.h>
int main(void)
{
long firsttwodig;
long cardnumber;
int sum = 0;
int count = 0;
cardnumber = get_long("card number:");
firsttwodig = cardnumber;
//first case of luhn alg
int workingcc = cardnumber;
while(workingcc > 0)
{
int lastdig = workingcc % 10;
sum = sum + lastdig;
workingcc = workingcc / 100;
}
//secound case of luhn alg
workingcc= cardnumber / 10;
while(workingcc > 0)
{
int lastdig = workingcc % 10;
int timestwo = lastdig * 2;
sum = sum +(timestwo % 10) + (timestwo / 10);
workingcc = workingcc / 100;
so this is half of the code but the part where it wont work i tried everything but the luhn algo part just wont work for some reasone the code it self works its just everything is invalid thans in advanced