Skip to content

Instantly share code, notes, and snippets.

View sylviahangnguyen's full-sized avatar
💭
debugging

Hang Nguyen sylviahangnguyen

💭
debugging
View GitHub Profile
#include <math.h> // library for pow()
#include <cs50.h> // library for get_long()
#include <stdio.h> // library for almost all C functions
int countDigits(long card); // initialise the function to count the number of digits before the main function
int sumDigits(long card, int len, unsigned long long int power); // initialise the function to check the Luhn sum
int main(void)
{
// PROMPT THE CARD NUMBER (INPUT)
Initialise the 1stsub function to count the number of digits before the main function
Initialise the 2nd sub function to check the Luhn sum
Main funtion
// PROMPT THE CARD NUMBER (INPUT)
Initialise the type of card (from 13 to 16 digits)
Get the card number from user
Avoid the negative long and 0
// GET THE DIGIT COUNT TO CHECK FOR THE CARD'S LENGTH => CARD'S TYPE
@sylviahangnguyen
sylviahangnguyen / sampleREADME.md
Created July 18, 2020 09:08 — forked from FrancesCoronel/sampleREADME.md
A sample README for all your GitHub projects.

FVCproductions

INSERT GRAPHIC HERE (include hyperlink in image)

Repository Title Goes Here

Subtitle or Short Description Goes Here