0

//10 minutes shower = 120 bottles water

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

     int main(void)
        { 
            int showertime = 0;
            int bottles = 0;
            const int y=12;
            printf("Give me the minutes of your time in shower: ");
            int showerminutes = GetInt();
            int bottles = ( y * int showerminutes );


            printf("Bottles of water you used when showering %i\n" , int bottles );
        }

2 Answers 2

1

If you use the GetInt () function you must include the header file cs50.h

2
  • Okay it works now! Ending curly bracket was in wrong place. Jul 31, 2016 at 17:44
  • Great. Can you please accept one of the answers to remove the question from the unanswered question pool? thanks.
    – Cliff B
    Aug 3, 2016 at 0:50
1

The function GetInt() is a function defined in the header cs50.h... You need to always #include whenever you use functions like GetInt(), GetFloat() & GetString()

1
  • Okay I added it. Jul 31, 2016 at 15:17

You must log in to answer this question.

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