summaryrefslogtreecommitdiff
path: root/_Programming_With_C/chapter4.ipynb
diff options
context:
space:
mode:
Diffstat (limited to '_Programming_With_C/chapter4.ipynb')
-rw-r--r--_Programming_With_C/chapter4.ipynb17
1 files changed, 0 insertions, 17 deletions
diff --git a/_Programming_With_C/chapter4.ipynb b/_Programming_With_C/chapter4.ipynb
index 1f1dcee7..21edac6f 100644
--- a/_Programming_With_C/chapter4.ipynb
+++ b/_Programming_With_C/chapter4.ipynb
@@ -25,7 +25,6 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "# lowercase to uppercase conversion\n",
"\n",
"\n",
"ch='a'\n",
@@ -55,7 +54,6 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "# shows the use of print function\n",
"\n",
"import math\n",
"\n",
@@ -87,7 +85,6 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "# generates the same floating point output in 2 different ways\n",
"\n",
"x,y=5000.0,0.0025\n",
"\n",
@@ -122,7 +119,6 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "# reading and writing a line of text\n",
"\n",
"line=\"The PITTSBURG STEELERS is one of America's favorite football teams!\"\n",
"print \"%s\" %(line)\n",
@@ -152,7 +148,6 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "# illustrates the use of the minimum field width feature\n",
"\n",
"i=12345\n",
"x=345.678\n",
@@ -190,7 +185,6 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "# makes use of g-type conversion\n",
"\n",
"i=12345\n",
"x=345.678\n",
@@ -230,7 +224,6 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "# illustrates the use of precision feature with floating points\n",
"\n",
"x=123.456\n",
"\n",
@@ -265,7 +258,6 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "# displays floating points numbers with only precision specification\n",
"\n",
"\n",
"x=123.456\n",
@@ -301,7 +293,6 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "# illustrates the use of field width and precision specifications with string\n",
"\n",
"line=\"hexadecimal\"\n",
"\n",
@@ -333,7 +324,6 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "# illustrates the use of upper case conversion characters\n",
"\n",
"a=0x80ec\n",
"b=0.3e-12\n",
@@ -370,7 +360,6 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "# illustrates the use of flags with integers and floating point quantities\n",
"\n",
"i,x,y=123,12.0,-3.3\n",
"\n",
@@ -378,7 +367,6 @@
"print \":%-6d %-7.0f %-10.1e: \\n\" %(i,x,y)\n",
"print \":%+6d %+7.0f %+10.1e: \\n\" %(i,x,y)\n",
"print \":%-+6d %-+7.0f %-+10.1e: \\n\" %(i,x,y)\n",
- "print \":%7.0f %#7.0f %7g %#7g: \\n\" %(x,x,y,y)\n",
"\n",
"\n"
],
@@ -415,13 +403,11 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "# use of flags with unsigned decimal octal and hexadecimal numbers\n",
"\n",
"i,j,k=1234,01777,0xa08c\n",
"\n",
"print \":%8u %8o %8x:\\n\" %(i,j,k)\n",
"print \":%-8u %-8o %-8x:\\n\" %(i,j,k)\n",
- "print \":%#8u %#8o %#8x:\\n\" %(i,j,k)\n",
"print \":%08u %08o %08x:\\n\" %(i,j,k)\n",
"\n",
"\n",
@@ -458,7 +444,6 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "# illustrates the use flags with strings\n",
"\n",
"line=\"lower-case\"\n",
"\n",
@@ -494,7 +479,6 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "# illustrates how printed ouput can be labeled\n",
"\n",
"a,b,x1,x2=2.2,-6.2,0.005,-12.88\n",
"\n",
@@ -529,7 +513,6 @@
"cell_type": "code",
"collapsed": false,
"input": [
- "# averaging student exam scores\n",
"\n",
"\n",
"name=\"Robert Smith\"\n",