Example: bankruptcy

Programming and Problem Solving Through C Language

Programming and Problem SolvingThrough C Language Programming andProblem SolvingThrough C Language (An Imprint of Laxmi Publications Pvt. Ltd.)BANGALORE CHENNAI COCHIN GUWAHATI HYDERABADJALANDHAR KOLKATA LUCKNOW MUMBAI RANCHINEW DELHI BOSTON, USAFIREWALL MEDIARAMESH , Dip. Comp. Sc. (IIT D)Formerly: Incharge Computer Centre,Hindustan Copper Limited, New DelhiEx. Managing Editor: Software TodayM3 - R4 STRICTLY AS PER NEW DOEACC SYLLABUS P ublished by :FIREWALL MEDIA(A n Im print of L axm i P ublications P vt. L td.)113, G olden H ouse, D aryaganj,N ew D elhi-110002P hone: 011-43 53 25 00F ax: 011-43 53 25 28w w w .laxm @ laxm rice : O ew E ditionO F F IC E S B an galore080-26 75 69 30 C h en n ai044-24 34 47 26 C och in0484-237 70 04, 405 13 03 G u w ah ati0361-251 36 69, 251 38 81 H yd erab ad040-24 65 23 33 J alan d h ar0181-222 12 72 K olk ata033-22 27 43 84 L u ck n ow0522-220 99 16 M u m b ai022-24 91 54 15, 24 92 78 69 R an ch i0651-221 47 64 FPR-3108-295-PROG PROB SOL TH C LANG-BAN C 5519/012/08 Typeset at : Kalyani Computer Services, Delhi.

Address operators, pointer type declaration, pointer assignment, pointer initialization, pointer arithmetic, functions and pointers, Arrays and Pointers, pointer arrays, pointers and structures, dynamic memory allocation. 10. Self Referential Stuctures and Linked Lists 04 Hrs.

Tags:

  Problem, Solving, Protein, Problem solving

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of Programming and Problem Solving Through C Language

1 Programming and Problem SolvingThrough C Language Programming andProblem SolvingThrough C Language (An Imprint of Laxmi Publications Pvt. Ltd.)BANGALORE CHENNAI COCHIN GUWAHATI HYDERABADJALANDHAR KOLKATA LUCKNOW MUMBAI RANCHINEW DELHI BOSTON, USAFIREWALL MEDIARAMESH , Dip. Comp. Sc. (IIT D)Formerly: Incharge Computer Centre,Hindustan Copper Limited, New DelhiEx. Managing Editor: Software TodayM3 - R4 STRICTLY AS PER NEW DOEACC SYLLABUS P ublished by :FIREWALL MEDIA(A n Im print of L axm i P ublications P vt. L td.)113, G olden H ouse, D aryaganj,N ew D elhi-110002P hone: 011-43 53 25 00F ax: 011-43 53 25 28w w w .laxm @ laxm rice : O ew E ditionO F F IC E S B an galore080-26 75 69 30 C h en n ai044-24 34 47 26 C och in0484-237 70 04, 405 13 03 G u w ah ati0361-251 36 69, 251 38 81 H yd erab ad040-24 65 23 33 J alan d h ar0181-222 12 72 K olk ata033-22 27 43 84 L u ck n ow0522-220 99 16 M u m b ai022-24 91 54 15, 24 92 78 69 R an ch i0651-221 47 64 FPR-3108-295-PROG PROB SOL TH C LANG-BAN C 5519/012/08 Typeset at : Kalyani Computer Services, Delhi.

2 Printed at : Ajit Printing Press, opyright 2013 by L axm i P ublications P vt. L td. A ll rights o part of this publication m ay be reproduced, stored in a retrieval system , ortransm itted in any form or by any m eans, electronic, m echanical, photocopying,recording or otherw ise w ithout the prior w ritten perm ission of the publisher. ContentsIXContents1. Introduction to Programming .. The Basic Model of Computation .. Problem Programming Linking and Testing and Debugging .. 312. Algorithms for Problem Solving .. 3 Exchanging Values of Two Summation of a Set of Numbers .. Decimal Base to Binary Base Conversion .. Reversing Digits of an Integer .. GOD (Greatest Common Divisor) of Two Test Whether a Number is Prime .. Organize Numbers in Ascending Order .. Find Square Root of a Number .. Factorial Sequence .. Sin x as Sum of a Order of Elements of an Array.

3 Largest Number in an Array .. Elements of Upper Triangular a of Two Matrices .. 513. Introduction to C Language .. 5 Character set .. Variables and Built-in Data Types .. Variable Arithmetic operators .. Constants and Literals .. Simple Assignment Statement .. Basic Input/Output Statement .. 754. Conditional Statements and 8 Decision Making within a Conditions and Relational Operators .. Logical Connectives .. If statement .. If-else statement .. While loop .. Do For loops .. Loops .. 113 (VI) statement .. 1235. Arrays .. Introduction to Arrays .. Array Manipulation .. Deletion of an Element from an Array .. Finding the Largest/Smallest Element in an Array .. Two Dimensional Addition/Multiplication of Two Matrices .. Transpose of a Square Matrix .. Terminated Strings as Array of Characters.

4 Library String Functions .. Bounds Checking .. and Functions .. Visualizing A C Vector Access .. Arrays and Functions .. 1716. Top-down Approach of Problem Solving .. Modular Programming and Functions .. Standard Library of C Functions .. Prototype of a Function .. Format Parameter Return Type .. Function Passing Arguments to a Function .. by by Functions .. as Function Arguments .. 2197. Storage Scope and Extent .. Storage Classes in a Single Source File .. Storage Classes in Multiple Source Files .. 2358. Structures and Structure Variables .. Structure Assignment .. Nested Structure .. Structures and Functions .. Structures and Arrays .. Arrays of Structures .. Structures containing Arrays .. 267(VII)9. Address Pointer Type Declaration .. Pointer Assignment.

5 Pointer Pointer Functions and Pointers .. Arrays and Pointers .. Pointer Arrays .. Pointers and Structures .. Memory 30210. Self Referential Structures and Linked Lists .. of a Singly Connected Linked List .. a Linked List .. into a Linked List .. from a Linked 35611. File of Files .. Opening in Various Modes .. of a File .. from a Writing onto a File .. 376 Sample Paper 1 ..379 Sample Paper 2 ..383 Sample Paper 3 ..387 Sample Paper 4 ..391 Sample Paper 5 .. 405 AuthorSYLLABUSM3-R4: Programming AND Problem SOLVINGTHROUGH C LANGUAGEThe objective of this course are to make the student understand programmng Language , Programming ,concepts of loops, reading a set of data, stepwise refinement, Functon, Control strucutres, completion of this course the student is expected to analyze the real life Problem and write aprogram in C Language to solve the Problem .

6 The main emphases of the course will on problemsolving aspect, i,e., developing proper the end of the course the students will be able to: Develop efficient algorithms for Solving a Problem . Use the various constructs of a Programming Language viz., conditional, iteration and recursion. Implement the algorithm in C Language . Use simple data structures like arrays, stacks, and linked list in Solving problems. Handling File in C .Outline of No. of to for Problem to C Staements and and Self Referential Structures and Linked Lists0411. File Processing04 Lectures=60 Practicals /Tutorials=60 Total= 120(XI)DETAILED to Programming04 Basic Model of Computation, Algorithms, Flow-Charts, Programming Languages,Compilation, Linking and Loading, Testing and Debugging, for Problem Solving10 values of two variables, Summation of a set of numbers, Decimal Baseto Binary Base Conversion, Reversing digits of an integer, GOD (Greatest CommonDivision)

7 Of two numbers, Test whether a number is prime, Organize numbers inascending order, Find square root of a number, Factorial computation, Fibonaccisequence, Evaluate sin x as sum of a series, Reverse order of elements of anarray, Find largest number in an array, Print elements of upper triangular matrix,multiplication of two matrices, Evaluate a to C Language04 set, Variables and identifiers, Built-in Data Types, Variable Definition,Arithmetic operators, and expressions, Constants and Literals, Simple assignmentstatement, Basic input/output statement, Simple C Statements and Loops07 making within a program, Conditions, Relational Operators, LogicalConnectives, If statement, If-else statement, Loops, While loop, Do while, For loop,Nested loops, Infinite loops, Switch statement, Structured dimensional arrays, Array manipulation; Searching, Insertion, Deletion of anelement from an array; Finding the largest/smallest element in an array; Twodimensional arrays; Addition/Multiplication of two matrices, Transpose of a squarematrix; Null terminated strings as array of characters, Standard library string approach of Problem Solving , Modular Programming and functions,Standard Library of C functions, Prototype of a function; Format parameter list,Return Type, Function call, Block structure, Passing arguments to a Function; callby reference, call by value, Recursive Functions, arrays as function Classes03 and extent, Storage Classes in a single source file; auto, extern and static,register, Storage Classes in a multiple source files; extern and static.

8 (XII) and Unions06 variables, initialization, structure assignment, nested structure, structuresand functions, structures and arrays; arrays of structures, structures containing arrays, operators, pointer type declaration, pointer assignment, pointer initialization,pointer arithmetic, functions and pointers, Arrays and Pointers, pointer arrays, pointersand structures, dynamic memory Self Referential Stuctures and Linked Lists04 of a singly connected linked list, Traversing a linked list, Insertion into alinked list, Deletion from a linked File Processing04 of Files, File opening in various modes and closing of a file, Reading froma file, Writing onto a THE BASIC MODEL OF COMPUTATIONA good programmer is an asset to the company. But, nobody is born to write programs. A goodprogrammer is not born but is developed by his own actions.

9 These actions make him a goodprogrammer. There is a methology which he has to follow to become a good programmer. In thischapter I will discuss this methology, and how it is used while writing programs irrespective of thelanguage he is is a team effort. What can a good programmer do if the inputs to him are given has to coordinate between the various users and data providers to cater to their needs and write agood program which would produce the results the user is looking forward to. A manager, for example,is not concerned how the Problem is solved or how the data is obtained. He is only interested inresults which the program is supposed to writing any program the programmer has to keep lots of things in mind. Few of them have beenmentioned above, the others including Problem definition, program design, coding, debugging, testing,documentation, maintenance and redesign. Let us start with the general concepts used for writing General ConceptsProgram writing is definitely a technique.

10 One has to master it by experience. One should alwaysstart with writing small and simple programs and then graduate to complex and complicated he may write, it should be written in a manner which is understood by others. God forbidif he is not around the others should be able to run and modify it. Here the documentation parts becomesvery necessary. I will talk about it little later but first let us see what a good program should good program should have the following characteristics:1. Readability2. Efficiency3 . Reliability4. Meaningfulness5. Portability6. us read about them in little ReadabilityAs mentioned above the program should be such that it can be read and understood by others. Thismakes it easy to modify by and Problem Solving Through C EfficiencyWhile writing the program the programmer must take care of the following:1. ProcessingHe should make sure that the program takes the minimum processing MemoryMimimum utalization of memory and hard disk space should be TimeThe programmer should be able to produce the program in time frame RealiabilityIt goes beyond saying that the program should be reliable and must be in a position to produce goodand accurate results.


Related search queries