Commits

Ramakrishna Reddy Yekulla  committed 6bd94eb

Assignment 07 complete

  • Participants
  • Parent commits dc12fb5

Comments (0)

Files changed (5)

File abs/notes.rst

   - Tree Insert
   - Find
   - Binary Search
-* Therory 
+* Theory 
   - Singleton
   - Factory
   - Memory ( Stack, Heap, Heap vs Stack)
-  - Bit Mnipulation
+  - Bit Manipulation
   - Big-O
   - Space Time complexity
 

File lcthw/#ex07.c#

+#include <stdio.h>
+
+int main(int argc, char *argv[])
+{
+  int bugs = 100;
+  double bug_rate = 1.2;
+
+  printf("You have %d bugs at the imaginary rate of %f. \n",
+	 bugs, bug_rate);
+  
+  long universe_of_defects = 1L * 1024L * 1024L * 1024L;
+  printf("The entire universe has %ld bugs. \n",
+	 universe_of_defects);
+
+  double expected_bugs = bugs * bug_rate;
+  printf("You are expected to have %f bugs. \n",
+	 expected_bugs);
+
+  double part_of_universe = expected_bugs / universe_of_defects;
+  printf("That is only a %e portion of the univese. \n",
+	 part_of_universe);
+
+  char nul_byte = '\0';
+  int care_percentage = bugs * nul_byte;
+  printf("Which means you should care %d%%. \n",
+	 care_percentage);
+
+  return 0;
+
+}
+
+
+    

File lcthw/ex07

Binary file added.

File lcthw/ex07.c

+#include <stdio.h>
+
+int main(int argc, char *argv[])
+
+{
+  int bugs = 100;
+  double bug_rate = 1.2;
+
+  printf("You have %d bugs at the imaginary rate of %f. \n",
+	 bugs, bug_rate);
+  
+  long universe_of_defects = 1L * 1024L * 1024L * 1024L;
+  printf("The entire universe has %ld bugs. \n",
+	 universe_of_defects);
+
+  double expected_bugs = bugs * bug_rate;
+  printf("You are expected to have %f bugs. \n",
+	 expected_bugs);
+
+  double part_of_universe = expected_bugs / universe_of_defects;
+  printf("That is only a %e portion of the univese. \n",
+	 part_of_universe);
+
+  char nul_byte = '\0';
+  int care_percentage = bugs * nul_byte;
+  printf("Which means you should care %d%%. \n",
+	 care_percentage);
+
+  return 0;
+
+}
+
+
+    

File lcthw/ex07.c~

+#include <stdio.h>
+
+int main(int argc, char *argv[])
+
+{
+  int bugs = 100;
+  double bug_rate = 1.2;
+
+  printf("You have %d bugs at the imaginary rate of %f. \n",
+	 bugs, bug_rate);
+  
+  long universe_of_defects = 1L * 1024L * 1024L * 1024L;
+  printf("The entire universe has %1d bugs. \n",
+	 universe_of_defects);
+
+  double expected_bugs = bugs * bug_rate;
+  printf("You are expected to have %f bugs. \n",
+	 expected_bugs);
+
+  double part_of_universe = expected_bugs / universe_of_defects;
+  printf("That is only a %e portion of the univese. \n",
+	 part_of_universe);
+
+  char nul_byte = '\0';
+  int care_percentage = bugs * nul_byte;
+  printf("Which means you should care %d%%. \n",
+	 care_percentage);
+
+  return 0;
+
+}
+
+
+