diff options
author | kinitrupti | 2017-05-12 18:53:46 +0530 |
---|---|---|
committer | kinitrupti | 2017-05-12 18:53:46 +0530 |
commit | 6279fa19ac6e2a4087df2e6fe985430ecc2c2d5d (patch) | |
tree | 22789c9dbe468dae6697dcd12d8e97de4bcf94a2 /Practical_C_Programming_by_Steve_Oualline/Chapter_19_1.ipynb | |
parent | d36fc3b8f88cc3108ffff6151e376b619b9abb01 (diff) | |
download | Python-Textbook-Companions-6279fa19ac6e2a4087df2e6fe985430ecc2c2d5d.tar.gz Python-Textbook-Companions-6279fa19ac6e2a4087df2e6fe985430ecc2c2d5d.tar.bz2 Python-Textbook-Companions-6279fa19ac6e2a4087df2e6fe985430ecc2c2d5d.zip |
Removed duplicates
Diffstat (limited to 'Practical_C_Programming_by_Steve_Oualline/Chapter_19_1.ipynb')
-rwxr-xr-x | Practical_C_Programming_by_Steve_Oualline/Chapter_19_1.ipynb | 197 |
1 files changed, 197 insertions, 0 deletions
diff --git a/Practical_C_Programming_by_Steve_Oualline/Chapter_19_1.ipynb b/Practical_C_Programming_by_Steve_Oualline/Chapter_19_1.ipynb new file mode 100755 index 00000000..00ddd7e8 --- /dev/null +++ b/Practical_C_Programming_by_Steve_Oualline/Chapter_19_1.ipynb @@ -0,0 +1,197 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:4ee1b1671641fa0922389d9bf11b94f42d9755534b4f0476bbe2f9ceb3b1bc7e" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 19: Ancient compilers" + ] + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 19.1, Page number: 385" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Function declaration\n", + "def area (width, height) :\n", + " return width * height\n", + "\n", + "# Calculation and result\n", + "size = area (3.0, 2)\n", + "print ('Area is %f\\n' % size)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Area is 6.000000\n", + "\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 19.2, Page number: 386" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Function declaration\n", + "def square (s) :\n", + " return s * s\n", + "\n", + "# Calculation and result\n", + "i = square (5)\n", + "print ('i is %d\\n' % i)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "i is 25\n", + "\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 19.3, Page number: 386" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Function declaration\n", + "def sum (i1, i2, i3) :\n", + " return i1 + i2 + i3\n", + "\n", + "# Calculation and result\n", + "print ('Sum is %d\\n' % sum (1, 2, 3))" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Sum is 6\n", + "\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 19.4, Page number: 387" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Variable declaration\n", + "first = 'John'\n", + "last = 'Doe'\n", + "\n", + "# Calculation and result\n", + "full = first + ' ' + last\n", + "print ('The name is %s\\n' % full)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The name is John Doe\n", + "\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Example 19.5, Page number: 390" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "# Function declaration\n", + "def area (width, height) :\n", + " return width * height\n", + "\n", + "# Calculation and result\n", + "size = area (3.0, 2.0)\n", + "print ('Area is %f\\n' % size)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Area is 6.000000\n", + "\n" + ] + } + ], + "prompt_number": 5 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file |