Facebook
From Speedy Armadillo, 5 Years ago, written in C.
Embed
Download Paste or View Raw
Hits: 289
  1. #include <stdio.h>
  2. int main(int argc, char *argv[])
  3. {
  4.  int bugs = 100;
  5.  double bug_rate = 1.2;
  6.  printf("You have %d bugs at the imaginary rate of %f.\n",
  7.  bugs, bug_rate);
  8.  long universe_of_defects = 1L * 1024L * 1024L * 1024L;
  9.  printf("The entire universe has %ld bugs.\n",
  10.  universe_of_defects);
  11.  double expected_bugs = bugs * bug_rate;
  12.  printf("You are expected to have %f bugs.\n",
  13.  expected_bugs);
  14.  double part_of_universe = expected_bugs / universe_of_defects;
  15.  printf("That is only a %e portion of the universe.\n",
  16.  part_of_universe);
  17.  // this makes no sense, just a demo of something weird
  18.  char nul_byte = '\0';
  19.  int care_percentage = bugs * nul_byte;
  20.  printf("Which means you should care %d%%.\n",
  21.  care_percentage);
  22.  return 0;
  23. }
  24.  

Replies to Untitled rss

Title Name Language When
Re: Untitled Sloppy Hamerkop c 5 Years ago.