This commit is contained in:
Joaquin Gottlebe
2025-07-30 15:57:48 +02:00
parent e49fcfac46
commit a639c34cee
273 changed files with 20151 additions and 0 deletions
+56
View File
@@ -0,0 +1,56 @@
//// TODO ////
#include <cs50.h>
#include <stdio.h>
int main(void)
{
int modulo = 0;
int start = 0;
long number = 0;
// Promt for input
number = get_long("Number: ");
printf("%li\n", number);
// Calculate checksum
//for (int i = length; i < length; i-=2)
//{
// printf("number[i]");
//}
// Check for card length and starting digits
// If invalid Print INVALID\n
if (modulo != 0)
{
printf("INVALID\n");
}
// Else
else
{
// Print AMEX\n
if (start == 34 || start == 37)
{
printf("AMEX\n");
}
// Print MASTERCARD\n
else if (start == 51 || start == 52 || start == 53 || start == 54 || start == 55)
{
printf("MASTERCARD\n");
}
// Print VISA\n
else if (start == 4)
{
printf("VISA\n");
}
}
}