a thoughtful web.
Good ideas and conversation. No ads, no tracking.   Login or Take a Tour!
comment by user-inactivated
user-inactivated  ·  4032 days ago  ·  link  ·    ·  parent  ·  post: What language(s) are you currently learning?

Well, I decided I didn't like Scheme's syntax + there aren't many frameworks & libraries that support it.

I'm learning C now, and I like it a lot more. The main reason I'm learning C is that I plan to use OpenWRT for a science fair. Your code above is pretty damn beautiful, though.

I wrote a program yesterday because my sister wanted a program related to flowers. (✿◠‿◠)

  #include <stdio.h>
  main()
  {
    int rose_amt = 12;
    int daisy_amt = 7;
    int tulip_amt = 23;
    int sunflower_amt = 42;
    int rose;
    int daisy;
    int tulip;
    int sunflower;
    int exit_value;

    printf("This program will calculate the grand total number of days\nit will take for four different kinds of flowers to grow.\n\n");
    printf("Roses take %d days to grow.\n", rose_amt);
    printf("Daisies take %d days to grow.\n", daisy_amt);
    printf("Tulips take %d days to grow.\n", tulip_amt);
    printf("Sunflowers take %d days to grow.\n", sunflower_amt);

    printf("\nHow many roses do you wish to plant?\n");
    scanf(" %d", &rose );

    printf("How many daisies do you wish to plant?\n");
    scanf(" %d", &daisy);

    printf("How many tulips do you wish to plant?\n");
    scanf(" %d", &tulip);

    printf("How many sunflowers do you wish to plant?\n");
    scanf(" %d", &sunflower);

    printf("\nIt will take a grand total of %d days for all the flowers to grow.\n", rose*rose_amt+daisy*daisy_amt+tulip*tulip_amt+sunflower*sunflower_amt);
    printf("\nWould you like to exit?\n");
    scanf("%d");
    return 0;
  }