diff options
Diffstat (limited to 'ANSI_C_Programming_by_Yashwant_Kanetkar/chapter1.ipynb')
-rwxr-xr-x | ANSI_C_Programming_by_Yashwant_Kanetkar/chapter1.ipynb | 200 |
1 files changed, 200 insertions, 0 deletions
diff --git a/ANSI_C_Programming_by_Yashwant_Kanetkar/chapter1.ipynb b/ANSI_C_Programming_by_Yashwant_Kanetkar/chapter1.ipynb new file mode 100755 index 00000000..1c3108fa --- /dev/null +++ b/ANSI_C_Programming_by_Yashwant_Kanetkar/chapter1.ipynb @@ -0,0 +1,200 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:a5caa773def394b4fd51c60fb4856df2fdb5f2105f126537a15f6520ea337bff" + }, + "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 ON 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 ON 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 on 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 ON 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": {} + } + ] +}
\ No newline at end of file |