Questions tagged [problem-set-1]

The tag has no usage guidance.

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

CS50 problem set 1 cash

#include <stdio.h> #include <math.h> #include <cs50.h> int main(void) { // Get float for cents // Take inputs of positive floats and repromt user for negative float ...
0
votes
1answer
44 views

Cash Program not returning correct value for .41

I'm working on the Cash program in Week 2 and I think I have it all finished up the only problem is when I run check50 I get everything right except for .41 instead of returning 4 coins it gives an ...
0
votes
2answers
21 views

Nothing prints in Mario Problem

Why is the condition in my code not being met? I did clang mario.c and there was no error message. Then I did make mario and proceeded to start compiling my code yet every number from 1 to 8 leads the ...
0
votes
1answer
30 views

Problem set 1 Mario variable issue

I've been staring at my computer for so long trying little tweeks to fix the error message. TLDR how do I stop the shadow message from appearing and initialize variable h? The image looks confusing ...
0
votes
1answer
47 views

i am working on problem set1 Cash. “else if” is not working

everything is working fine until the condition of remainder <= 5 is met (else if) then it just executes the first part only (if). #include <stdio.h> #include <math.h> #include <cs50....
0
votes
1answer
21 views

Can I use if-statement or switch-statement instead of a for loop!

I just want to know if it is possible to use conditions instead of loop in the problem set 1 (Mario), because I think that it's easier to get to the intended output without much code!?
0
votes
1answer
98 views

continue from 2018 to 2019

I had submitted problem Sets 0 – 7 last year, except problem set 4 (0-3) (5-7), problem set 8 and the final project. what should I do?
1
vote
2answers
73 views

mario.c (comrfortable) error code

I ran the test and it was an error #include <cs50.h> #include <stdio.h> int Height; int space; int hash; int rows; int main(void) { do { printf("Welcome to Mario, ...
0
votes
1answer
637 views

Stuck on Problem set 1! (greedy.c)

I've been trying to solve this problem for a while but I am completely stuck, so thought I'd ask for help. This is what I have so far: #include <stdio.h> #include <cs50.h> int main(void)...
0
votes
1answer
178 views

Code check for bad credit pset1

This is my attempt for the bad credit problem in pset1 and I'm having trouble debugging my code. Any help would be appreciated. #include <stdio.h> #include <cs50.h> bool checksum(long ...
1
vote
1answer
71 views

Problem set 1 Greedy My code is wrong… Way?

#include <stdio.h> #include <cs50.h> #include <math.h> int main(void) { float f; int y; // User block do{ printf("How much change do you ...
2
votes
2answers
1k views

Hello world error

I was trying to make this simple Hello World program, however I receive the following errors. Someone can explain me why? Program: #include <cs50.h> #include <stdio.h> int main (void) { ...
0
votes
3answers
514 views

cs50 Problem Set 1: Greedy. float 0.01 problem

sorry for the long title I'm currently doing cs50's problem set 1's Greedy and I've run into an issue. It seems that every cent works except for one's that need to use .01 cent. I've changed my code ...