summaryrefslogtreecommitdiff
path: root/Teach_Yourself_C_in_24_Hours/hour3.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'Teach_Yourself_C_in_24_Hours/hour3.ipynb')
-rwxr-xr-xTeach_Yourself_C_in_24_Hours/hour3.ipynb103
1 files changed, 103 insertions, 0 deletions
diff --git a/Teach_Yourself_C_in_24_Hours/hour3.ipynb b/Teach_Yourself_C_in_24_Hours/hour3.ipynb
new file mode 100755
index 00000000..95b6416b
--- /dev/null
+++ b/Teach_Yourself_C_in_24_Hours/hour3.ipynb
@@ -0,0 +1,103 @@
+{
+ "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": {}
+ }
+ ]
+} \ No newline at end of file