{ "metadata": { "name": "", "signature": "sha256:8e3cf2addd66f79ee38d4e50bfee328191c27b60f9cde7a75aa445057c2c6240" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter 1: Programming in C" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Program 1.1, page no. 6" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "\n", "print \"Hello world!\"\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Hello world!\n" ] } ], "prompt_number": 1 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Program 1.2, page no. 7" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "print \"\\\"If at first you don't succeed, try, try, try again!\\\"\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "\"If at first you don't succeed, try, try, try again!\"\n" ] } ], "prompt_number": 2 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Program 1.3, page no. 8" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "print \"Beware the Ides of March!\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Beware the Ides of March!\n" ] } ], "prompt_number": 3 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "program 1.4, page no. 14" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "print \"My formula for success?\\nRise early, work late, strike oil.\\n\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "My formula for success?\n", "Rise early, work late, strike oil.\n", "\n" ] } ], "prompt_number": 4 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ " Program 1.5, page no. 14" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "print \"\\\"It is a wise father that knows his own child.\\\"\\nShakespeare\\n\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "\"It is a wise father that knows his own child.\"\n", "Shakespeare\n", "\n" ] } ], "prompt_number": 5 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Program 1.6, page no. 15" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "print \"Be careful!!\\n \\a\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Be careful!!\n", " \u0007\n" ] } ], "prompt_number": 6 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Program 1.7, page no. 20" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\n", "\n", "print \"Hi there!\\nThis program is a bit longer than the others.\"\n", "print \"But really it's only more text.\\n\\a\\a\"\n", "print \"Hey, wait a minute!! What was that???\\n\"\n", "print \"\\t1.\\tA bird?\"\n", "print \"\\t2.\\tA plane?\"\n", "print \"\\t3.\\tA control character?\"\n", "print \"\\t\\t\\b\\bAnd how will this look when it print's out?\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Hi there!\n", "This program is a bit longer than the others.\n", "But really it's only more text.\n", "\u0007\u0007\n", "Hey, wait a minute!! What was that???\n", "\n", "\t1.\tA bird?\n", "\t2.\tA plane?\n", "\t3.\tA control character?\n", "\t\t\b\bAnd how will this look when it print's out?\n" ] } ], "prompt_number": 7 } ], "metadata": {} } ] }