Skip to main content

Questions tagged [pset1-credit]

The tag has no usage guidance.

10 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0 votes
2 answers
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....
sam's user avatar
  • 1
0 votes
1 answer
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(...
siv12345's user avatar
0 votes
1 answer
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?
Mukut Das's user avatar
0 votes
1 answer
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 ...
miekec's user avatar
  • 1
0 votes
1 answer
64 views

PSET1 - credit ,not satisfying all test cases ,please help

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. :( ...
Dhyey Patel's user avatar
0 votes
1 answer
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 (...
VooDooDarkMagic's user avatar
0 votes
1 answer
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 ...
VooDooDarkMagic's user avatar
0 votes
0 answers
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 ...
AbbiePBC's user avatar
0 votes
1 answer
160 views

trying to check second to last digit-- cs50 pset 1 #credit#

I am trying to understand the second to last digit thing, i think i have been coding wrong the whole time. take this example 45002136581 in the walk through the guy says we take 5 0 2 1 5 1. while i ...
Tornado air's user avatar
0 votes
1 answer
69 views

Help in PSET1: Credit. Check50 not showing up

I finished (what I think) is a correct version of credit and when I submit, I only see marks for style and no check50 on the submit50 page. Also, when I do check50 in the terminal window, I get a "...
Suhas Thalanki's user avatar