• This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #465
    admin
    Keymaster
      
      
      #include <stdio.h>
      #include <cs50.h>
      int main(void)
      
      {
        int t = get_int("enter cents");
        int count25 = t / 25;
        int count10;
        t = t % 25;
        printf("count25 is %i\n", count25);
        printf("remaining t after count25 %i", t);
        if (t > 9)
        {
          count10 = t / 10;
        } 
         else
        {
          count10 = 0;
        }
        printf("count10 is%i\n", count10);
        int totalcoins = count25 + count10;
        printf("total coin count%i\n", totalcoins);
        
      }

      Cash project prepares one to start using functions in programming. However, the same can be also done without creating functions through the main function.

      cs50 cash project[learn_press_profile]

    Viewing 1 post (of 1 total)
    • You must be logged in to reply to this topic.
    Scroll to Top