Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added question details in chapters in which they were missing #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
200 changes: 200 additions & 0 deletions ANSI_C_Programming/.ipynb_checkpoints/chapter1-checkpoint.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
{
"metadata": {
"name": "",
"signature": "sha256:90d67b804f2d6ea1cd245c10aa788b889d877aef594e9fa5adb7fa4fe440ff07"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"CHAPTER 1: GETTING STARTED"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"EXAMPLE 1.1 PAGE:12"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
" \n",
" \n",
"p=1000\n",
"n=3\n",
"r=8.5\n",
"si=p*n*r/100 #formula for simple interest\n",
"print \"%f\\n\" % (si)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"255.000000\n",
"\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"EXAMPLE 1.2 PAGE:17"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
" \n",
"print \"Enter values of p,n,r\"\n",
"p=eval(raw_input())\n",
"n=eval(raw_input())\n",
"r=eval(raw_input())\n",
"si=p*n*r/100\n",
"print \"%f\\n\" % (si)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Enter values of p,n,r\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"stream": "stdout",
"text": [
"1000\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"stream": "stdout",
"text": [
"3\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"stream": "stdout",
"text": [
"8.5\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"255.000000\n",
"\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 1.3 page:18"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
" \n",
"print \"Enter a number\"\n",
"num=eval(raw_input()) #to take user input\n",
"print \"Now I am letting you on a secret...\\n\"\n",
"print \"You have just entered the number %d\\n\" % (num)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Enter a number\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"stream": "stdout",
"text": [
"30\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Now I am letting you on a secret...\n",
"\n",
"You have just entered the number 30\n",
"\n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"EXAMPLE 1.4 PAGE:23"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
" \n",
"a=pow(3,2) #(3**2) will also do the same operation\n",
"print \"%d\" % (a)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"9\n"
]
}
],
"prompt_number": 4
}
],
"metadata": {}
}
]
}
Loading