When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
1 messages ยท Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
i cant use other libraries besides those 2 included i believe
luhns algorithm takes second to last number and every other number after that, to multiply by 2 and add the numbers (12 = 1+2) together
and then add the other previously skipped numbers to the sum of the first result and checks if the last number is 0
Have you ever written any C program before?
Because from looking at your code it appears as if you've never even seen a "Hello World" program
I mean, there's so much wrong that I don't even know where to start
i just started C yesterday :/
How are you learning C?
oh i was just writing things down i wasnt worried about correctness yet
cs50
What is that?
its the online program from harvard
ah i see.
lemme quickly check what we recommend, I think CS50 is also part of it
!howto learn-c
We generally recommend a good book to learn the necessary fundamentals:
To actually write and run C code, you will need a compiler, editor, and debugger. We strongly recommend to start out using an IDE, which will provide all these tools for you:
The wise programmer is told about the debugger and uses it.
The average programmer is told about the debugger and avoids it.
The foolish programmer is told about the debugger and laughs at it.
yea lol
Okay, so that VISA card number validator is like your second or third homework?
But what do you want us to do then?
i just need help on building a mindset for how to approach the problem
well first could u tell me what is so wrong about my code ๐
I'm not even sure I could fit everything within the 2000 character limit of a Discord message
oh and for the printf("%s\n", type) the datatypes don't even match (i.e. %s is incorrect for long).
Oh, and you redeclare number in your main function, thereby shadowing the global number.
And I also missed a few other useless semicolons
You see how it's a mess to try and explain that?
Right now for me it's like trying to explain you how to build a house, but you can't even stack bricks onto each other
Please thoroughly re-read your study materials and go over all the past exercises
ah i see what you mean
but i was hoping you would understand what im trying to do, im more just typing down useful in the area im going to use it like for the (number/10)%10
just like type it down, worry about syntax later
but yea the useless semi colons are on me ๐
also the global variable i thought i would need to declare it before using the variable in the functions above main
@quasi umbra
Please don't delete forum posts. They can be helpful to refer to later and other members can learn from them. In the future you can use !solved to close a post and mark a post as solved.
!solved