# Questions tagged [pset1-credit]

The tag has no usage guidance.

10 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
16 views

### can anyone help error check my luhns algorithm code?

i wrote this version of the credit card number checking code and it still gives me an error when i check it. apparently, it validates 4111111111111113 and 4222222222223 as visa numbers when theyre not....
• 1
25 views

### PSET 1 - Credit, Mastercard validation failing

Trying to solve the Credit Question in PSET1, unable to get the mastercard number to validate. Attaching the code #include <cs50.h> #include <stdio.h> long get_card(void); int card_length(...
49 views

### Cs50 pset1 problem credit

I'm not able to take out the second digit of the credit number, how to do it for large numbers like 16 digit,15digit,14 digit?
142 views

### Pset1:credit - converting a long to a string causes a segfault?

I keep getting a segfault, and help50 doesn't help. A lot of head scratching an googling later, I think I've narrowed it down to: you can't convert a long to a string. Is that true? The code in ...
64 views

These are the test cases which my code doesn't satisfy ,can someone please help me out as i have absolutely no idea why it is happening. Some tips or advice would be handy. Thank you in advance. :( ...
47 views

### Pset1 Credit - Why is my code bypassing the Floor function inside If statement?

Here's my code- int f_1 = floor(N / 1000000000000000); int f_2 = floor(N / 1000000000000); int f_3 = floor(N / 100000000000000); int f_4 = floor(N / 10000000000000); if (...
77 views

### Pset1 Credit- How should I proceed to add the sum of multiplied digits & further addition with remaining credit card numbers?

I can pretty much select the digits, multiply the digits by 2 & add the particular digits of the multiplied number. But as of now I can only print them not add them. I also have to add this sum to ...
136 views

### Can anyone help me troubleshoot my code for the CS50 Credit problem? (**not trying to cheat, just need some help!)

This is the code I have written in c for the cs50 credit pset 1 problem. I am checking the length of numbers entered, and the first digits (AMEX 15 digits, starts with 34 or 37; MC 16 digits, starts ...