Hot answers tagged

2

I don't think you saw the video properly. To run c executable files, you should use ./ and the executable file's name. So in this case it is ./hello


1

Your mario.c file is not in your mario directory, but in your pset1 directory. Type mv ../mario.c ../mario into the terminal (or drag and drop the file into the mario folder, if the IDE allows it) and then rerun the make mario command and it should work.


1

Are you using your actual GitHub password or your access token's code? If you have enabled two-factor authentication with GitHub and you haven't created an access token, you will need to create one for CS50 as GitHub no longer allows submit50 to connect using your regular sign-in credentials. You can follow this link to learn how to do this: Creating a ...


1

The problem is in your nested for loop. It prints a space all the way up until i + j <= n - 1. Once this is no longer true, your program exits the loop. Let's look at this in a little more detail: If n = 7 and i = 0, the if statement in the nested loop will continue printing spaces until i + j > n - 1, meaning when j = 7. As soon as that happens, ...


1

~First of all when you prompt user why did you typed %s just put like this x = get_float( "change owed") ; ~Second mistake is logical For while loop you just have to divide the rounded number by 25 or 10 or 5 and so on. And then increment the number. Example while( y / 25){ Coins ++ } ; And so on :-)


1

try using /* */ to surround all of your comments instead of the other // prefix. i don’t know why, but my program wouldn’t pass the checks when i used //. it could be something to do with the 2021 upgrades or some issue with clang maybe, i really don’t know but might be worth a shot..


1

This is because you've overlooked an important piece of information provided with the explanation of Luhn's algorithm. It actually says in the algorithm to add the products' digits to the checksum and not the product itself(which you've done). Here's an excerpt from the pset1 page for your reference: According to Luhn’s algorithm, you can determine if a ...


Only top voted, non community-wiki answers of a minimum length are eligible