summaryrefslogtreecommitdiff
path: root/Programming_in_C/Chapter_03.ipynb
blob: 0f1f434791a4f287e5170241bdbf7da68c342b8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
{
 "metadata": {
  "name": "Chapter III"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": "Chapter 3: Compiling and running your first program"
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": "Program 3.1, Page number: 11"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "#3.1.py\n#first Python Program\n\n#Print Statement\nprint(\"Programming is Fun.\")",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "Programming is Fun.\n"
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": "Program 3.2, Page number: 14"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "#3.2.py\n#Writing Your First C Program(Version2)\n\n#Print statement\nprint(\"Programming is Fun.\")\nprint(\"And Programming in Python is even more fun\")",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "Programming is Fun.\nAnd Programming in Python is even more fun\n"
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": "Program 3.3, Page number: 14"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "#3.3.py\n#Displaying multiple Lines of output\n\n#Print statements using escape sequence\nprint(\"Testing...\\n..1\\n...2\\n....3\\n\")",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "Testing...\n..1\n...2\n....3\n\n"
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": "Program 3.4, Page number: 15"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "#3.4.py\n#Displaying Variables\n        \nsum=50+25\nprint(\"The sum of 50 & 25 is: {0} \".format(sum))",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "The sum of 50 & 25 is: 75 \n"
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": "Program 3.5, Page number: 16"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "#3.5.py\n#Displayig multiple values\n\n#Variable declaration\nvalue1=50\nvalue2=25\n\n#Calculation\nsum=value1+value2\n\n#Result\nprint(\"The sum of {0} & {1} is: {2}\".format(value1,value2,sum))",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "The sum of 50 & 25 is: 75\n"
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": "Program 3.6, Page number: 17"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "#3.6.py\n#Using Comment in a program\n\n#'#(Hash/Pound)' is used to display a comment in python\n#This is a comment\n\n#Variable declarations\nvalue1=50\nvalue2=25\n\n#Calculation\nsum=value1+value2\n\n#Result\nprint(\"The sum of {0} & {1} is {2}\".format(value1,value2,sum))",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "The sum of 50 & 25 is 75\n"
      }
     ],
     "prompt_number": 6
    }
   ],
   "metadata": {}
  }
 ]
}