Alright here's a rough code of how i started. some where some mistake has happened but not sure where and i wasnt sure how could i declare the functions im asked to use (readCC, isValid and runLuhn)

```
#include <stdio.h>
int isvalid(long num);
int sumofdoubleevenplace(long num);
int getdigit(int num);
int sumofoddplace(long num);
int prefixmatched(long num,int d);
int getsize(long d);
int getprefix(long num,int k);
main(){
long cardnum=0;
printf("Enter credit card number ");
scanf("%ld",&cardnum);
if(isvalid(cardnum)==1)
printf("Valid card number\n");
else
printf("Invalid card number\n ");
return 0;
}
int isvalid(long num){
if(((sumofoddplace(num)+sumofdoubleevenplace(num))%10==0)
&& (getsize(num)<=16 && getsize(num)>=13)
&& (prefixmatched(num,4)==1 || prefixmatched(num,5)==1 ||
prefixmatched(num,6)==1 || prefixmatched(num,37==1)))
return 1;
else
return 0;
}
int sumofdoubleevenplace(long num){
int numdigits=getsize(num)-1;
int sum=0,i;
num/=10;
for(i=0;i<numdigits;i+=2){
sum+=getdigit((int)(2*(num % 10)));
num/=100;
}
return sum;
}
```