0

I newbe in programming. When I run the Check50, error message is :) rejects "foo" minutes, :) rejects "" minutes, :) rejects "123abc" minutes. Please, can you tell me what it means so that I can work on my errors ? On the website, I found someone else having this trouble that resoluted by himself, so I added the if/else, but still have the same error message. Here's my code :

#include <cs50.h>
#include <stdio.h>

int main (void)
{
    int bottle = 12;

    printf("Minute : ");
    int Minute = get_int();

    if (Minute > 0)
    {
        printf("Bottles : %i\n", Minute * bottle);
    }

    else  
    {
        printf("Error \n");
    }
}
0

2 Answers 2

1

Like @Mars said, nothing is wrong with your program. The :) in check50 means that you did something right! An error in check50 is shown by a :(. For example, if your program didn't work, you'd get something like :( rejects "123abc" minutes followed by a line showing what the expected output was and what the actual output was.

If you still have issues, comment below.

0

Your program works perfectly, and there are no errors in check50, the function get_int (), is responsible for rejecting entries that contain a character

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .