Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
1 answer
98 views

credit.c I don't understand how to fix my code

I've been trying to figure out what's wrong with my code. I used printf so I could confirm whether or not the value of N is correct but it's coming out as completely different as what I would expect ...
maira's user avatar
  • 1
0 votes
1 answer
65 views

credit pset1 bruteforcing doesn't work

I was trying out credit and tried to write a code for all 15 digit cards so if a AMEX card exists it should work in theory. However even with valid cards I'm getting the input invalid. I have not ...
FoundABetterName's user avatar
0 votes
1 answer
42 views

ProblemSet1 - Another Credit.c issue - Can't convert the floating value of my variables into an integer value

I was almost finishing my code when I got stuck with a strange problem. I've asked a question a few hours ago and someone answered, so I manage to fix that issue. But unfortunelly I got stuck in ...
KevinWGS's user avatar
0 votes
1 answer
39 views

ProblemSet1 - Credit.c - Issues assigning the sum of the numbers on a variable

So I coded the first lines of the Luhn's Algorithm and tried to print the values of some of my variables to be sure they were doing exactly what I want it. For my surprise they weren't. And I were ...
KevinWGS's user avatar
0 votes
1 answer
166 views

Credit.c works, but not completely?

So I finished credit.c today and was trying out different numbers from the paypal website the course provided and got some unexpected results and don't know what to do with it. When I type in valid ...
xbufu's user avatar
  • 107
1 vote
2 answers
165 views

error at while loop cs50 Pset1 credit

I am getting an error at while loop it says error: '&&' within '||' [-Werror,-Wlogical-op-parentheses] while((credit % 10 >= 0) && (i < 15) || (i < 16)) here is my ...
Rakshith Sridharan's user avatar
0 votes
1 answer
133 views

pset1 - problem with credit ..help plz

I spent so many hours and still can't figure the problem, any guidance would be appreciated.. I checked against all the paypal test numbers and got same response as the staff's execution, though I got ...
Ahmed-ElKodsh's user avatar
1 vote
2 answers
616 views

Credit.c is my nemesis

I have no experience programming, and English is not my first language so I'm struggling a lot with this particular problem. In "credit.c" you have to prompt the user for a credit card number and ...
Julian Colombo's user avatar
0 votes
1 answer
91 views

pset1 Credit: how to write it shorter

This is my code for the problem. [admin: hiding the code] It works properly but it looks hideous. I am looking for some nice inputs to re-write it in a more elegant way.
Marco Emmanuel Noto's user avatar