From 6279fa19ac6e2a4087df2e6fe985430ecc2c2d5d Mon Sep 17 00:00:00 2001 From: kinitrupti Date: Fri, 12 May 2017 18:53:46 +0530 Subject: Removed duplicates --- .../chapter5.ipynb | 96 ++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100755 Programming_With_C_by_Byron_S._Gottfried/chapter5.ipynb (limited to 'Programming_With_C_by_Byron_S._Gottfried/chapter5.ipynb') diff --git a/Programming_With_C_by_Byron_S._Gottfried/chapter5.ipynb b/Programming_With_C_by_Byron_S._Gottfried/chapter5.ipynb new file mode 100755 index 00000000..ea09f2bd --- /dev/null +++ b/Programming_With_C_by_Byron_S._Gottfried/chapter5.ipynb @@ -0,0 +1,96 @@ +{ + "metadata": { + "name": "" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "

Preparing And Running A Complete C Program

" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "

Example 5.2, Page number: 5.4

" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math\n", + "\n", + "p,r,n=10000,10,3\n", + "i=r/100.0\n", + "\n", + "f=p*math.pow(1+i,n)\n", + "print \"The final value (F) is: %.2f\" %f\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The final value (F) is: 13310.00\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "

Example 5.4, Page number: 5.7

" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "import math\n", + "\n", + "a,b,c=2.0,5.0,3.0\n", + "d=math.sqrt(b*b-(4*a*c))\n", + "x1=(-b+d)/(2*a)\n", + "x2=(-b-d)/(2*a)\n", + "\n", + "print \"x1 = %e x2 = %e\" %(x1,x2)\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "x1 = -1.000000e+00 x2 = -1.500000e+00\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +} \ No newline at end of file -- cgit