{ "metadata": { "name": "", "signature": "sha256:ce290cf2bde2b380a50d312f15b1ca096cf17ef06fb76494e9775a2b07fbccc8" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Hour 3: Learning the Structure of a C program" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 3.1, Page No.48" ] }, { "cell_type": "code", "collapsed": false, "input": [ "print \"Howdy, neighbour! This is my first C program\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Howdy, neighbour! This is my first C program\n" ] } ], "prompt_number": 1 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 3.2, Page No.49" ] }, { "cell_type": "code", "collapsed": false, "input": [ "def integer_add(x,y):\n", " result = x+y\n", " return result\n", "#This program has no output because the function is not called in this program" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 2 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 3.3, Page No.50" ] }, { "cell_type": "code", "collapsed": false, "input": [ "def integer_add(x,y):\n", " result = x+y\n", " return result\n", "sum=integer_add(5,12)\n", "print \"The addition of 5 and 12 is \",sum" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The addition of 5 and 12 is 17\n" ] } ], "prompt_number": 3 } ], "metadata": {} } ] }