




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
In this you will get about c Language in very easy way all topic are coverd like pointers and files all topics are there so download and start learning
Typology: Schemes and Mind Maps
1 / 284
This page cannot be seen from the preview
Don't miss anything!
PROGRAMMING FOR PROBLEM SOLVING COURSE MATERIAL
Vision and Mission of the Institute:
VISION To be recognized as a premier institution in offering value based and futuristic quality technical education to meet the technological needs of the society MISSION To impart value based quality technical education through innovative teaching and learning methods To continuously produce employable technical graduates with advanced technical skills to meet the current and future technological needs of the society To prepare the graduates for higher learning with emphasis on academic and industrial research
Vision , Mission &PEOs of the Department of CSE
VISION
To produce globally competent and industry ready graduates in Computer Science & Engineering by imparting quality education with a know-how of cutting edge technology and holistic personality MISSION To offer high quality education in Computer Science & Engineering in order to build core competence for the graduates by laying solid foundation in Applied Mathematics, and program framework with a focus on concept building The department promotes excellence in teaching, research, and collaborative activities to prepare graduates for professional career or higher studies Creating intellectual environment for developing logical skills and problem solving strategies, thus to develop, able and proficient computer engineer to compete in the current global scenario Program Educational Objectives (PEOs) Excel in professional career or higher education by acquiring knowledge in mathematical, computing and engineering principles To provide intellectual environment for analyzing and designing computing systems for technical needs Exhibit professionalism, multidisciplinary teamwork and adapt to current
PROGRAMMING FOR PROBLEM SOLVING SUBJECT COURSE OUT-COMES
CO1 Demonstrate computer System and Software development process
CO2 Design algorithms and develop programs involving selection structures andlooping structures.
CO3 Implement memory management techniques perform string processing andOrganize heterogeneous data.
CO4 Organize files to manage large amount of data.
CO5 Design and develop large programs using functions and arrays.
CO6 Implement Searching and Sorting techniques
Computer technology plays an increasing role in the information revolution. Today, the application of computers is all pervasive in everybody’s life. A sound knowledge of how computers process data and information has, therefore, become indispensable for anyone who seeks employment not only in the area of IT but also in any other field.
COMPUTER PROGRAMMING Computer Programming is dedicated to writing, testing and maintaining programs that computers follow to perform their functions. To create programs that control the behavior of a machine, we need programming languages. This book enables students to master the necessary skills for computer programming with C language shows them how to use these skills wisely with data structures and algorithms.
C PROGRAMMING LANGUAGE C is a general-purpose structured programming language that is powerful, efficient and compact. C combines the features of high-level language with the elements of the assembler and is thus close to both man and machine. The growth of C during the last few years has been phenomenal. It has emerged as the language of choice for most applications due to speed, portability and compactness of code. It has now been implemented on virtually every sort of computer, from micro to mainframe.
HOW IS THE BOOK ORGANIZED The book covers the basic anatomy of a computer system, input devices, processor, output devices and memory management and also discusses algorithms and flowcharts in Unit-I. Unit I also introduces programming in C language, which talks about the basic structure of C programs and their execution, how to declare constants, variables and data types, details the input and output operations, built-in operators and how to build expressions using them and also covers decision making and looping structures. Unit-II provides detailed exposition of Arrays, Pointers, structures, Strings and the basic concepts of file are covered in Unit-III. Unit-IV covers the concepts of
arrays of strings Structures: Defining structures, initializing structures, unions, Array of structures Pointers: Idea of pointers, Defining pointers, Pointers to Arrays and Structures, Use of Pointers in self-referential structures, usage of self referential structures in linked list (no implementation) Enumeration data type
Unit - III: Preprocessor and File handling in C: Preprocessor: Commonly used Preprocessor commands like include, define, undef, if, ifdef, ifndef Files: Text and Binary files, Creating and Reading and writing text and binary files, Appending data to existing files, Writing and reading structures using binary files, Random access using fseek, ftell and rewind functions.
Unit - IV: Function and Dynamic Memory Allocation:
Functions: Designing structured programs, Declaring a function, Signature of a function, Parameters and return type of a function, passing parameters to functions, call by value, Passing arrays to functions, passing pointers to functions, idea of call by reference, Some C standard functions and libraries Recursion: Simple programs, such as Finding Factorial, Fibonacci series etc., Limitations of Recursive functions Dynamic memory allocation: Allocating and freeing memory, Allocating memory for arrays of different data types
Unit - V: Introduction to Algorithms: Algorithms for finding roots of a quadratic equations, finding minimum and maximum numbers of a given set, finding if a number is prime number, etc. Basic searching in an array of elements (linear and binary search techniques), Basic algorithms to sort array of elements (Bubble, Insertion and Selection sort algorithms), Basic concept of order of complexity through the example programs
TEXT BOOKS:
REFERENCE BOOKS:
SESSION PLANNER/LESSON PLANNER
L17&L18 conditionals and consequent branching with if, if-else, switch-case, ternary operator, goto,
T1&T
L19&L20 Iteration with for, while, do- while loops
T1&T
Input and Output L21 Simple input and output with scanf and printf, formatted I/O,
T1&T
L22 Introduction to stdin, stdout and stderr. Command line arguments
T1&T
unit -II (Arrays,strings,structures and pointers)
Arrays L23&L24 creating, accessing and manipulating elements of arrays -one Dimensional array
T1&T
L25,L26&L27 creating, accessing and manipulating elements of arrays -Two Dimensional array
T1&T
Strings: L28 Introduction to strings, handling strings as array of characters
T1,T2&R
L29&L30 basic string functions available in C (strlen, strcat, strcpy, strstr etc.)
T1,T2&R
L31 arrays of strings T1&T Structures: L32 Defining structures, initializing structures&Accessing
T1&T
L33 unions& Array of structures T1&T Pointers: L34 Idea of pointers, Defining pointers,
T1&T
L35 Pointers to Arrays and Structures
T1&T
L36 Use of Pointers in self- referential structures, usage of self referential structures in linked list
T1&T
L37 Enumeration data type T1&T
UNIT- III (preprocessor and file handling)
Preprocessor: L38 Commonly used Preprocessor commands like include, define, undef, if, ifdef, ifndef
T1&T
Files: L39 Text and Binary files T1&T L40&L41 Creating and Reading and writing text and binary files, Appending data to existing files
T1&T
L42 Writing and reading structures using binary files,
T1&T
L43 Random access using fseek, ftell and rewind functions.
T1&T
UNIT- IV (Function and Dynamic Memory Allocation)
Functions: L44 Designing structured programs, Declaring a function
T1&T
L45 Signature of a function, Parameters and return type of a function
T1&T
L46 passing parameters to functions, call by value &call by reference,
T1&T
L47&L48 Passing arrays to functions, passing pointers to functions
T1&T
Recursion: L49 Simple programs, such as Finding Factorial, Fibonacci series
T1&T
Dynamic memory allocation
Introduction to components of computer system
Introduction to C Programming Language:
JNTUH Previous Question papers
COMPUTE R SYSTEM
HARDWAR E SOFTWAR E
A Program is a set of instructions given to the computer to do various tasks what the user
wishes too. The instructions can be in the form of commands also. A Program(or) Instructions
(or) commands are given by the user to computer to fulfill the desired task. As computer cannot
understand human language so it needs the translators like compiler, interpreter, assembler to
convert the human language of instructions to binary.
i)DEFINITION OF COMPUTER:
It is a high speed electronic device. It helps to store large volumes of data safely and securely & retrieves it whenever required by the user. It receives input from user through input devices, process it, and sends output through output devices to user again
INPUT OUTPUT
(raw data/instructions) “Information “ i.e Processed Data
COMPUTER SYSTEMS: It is made up of 2 major components They are :
16
Computer Hardware :
These are the physical components of a computer It consists of 5 Parts
Input Devices
These are used to enter data and programs into the computer
These are for man to machine communication
Ex: Keyboard, mouse, scanner, touch screen, audio input, Digitizer, light pen, joysticks, Track ball, Space ball, z-mouse, Digital Camera, Microphone, finger print reader, barcode reader, Data Glove, web cam,
Output Devices
These are used to get the desired output from the computer These are for machine to man communication
ALU CU
Primary Memory
Input Device s
Output Device s
Secondary Memory
Hard drives A hard-disk drive (HDD) is a non-volatile device used for storage, located inside the computer case. Like the floppy drive, it holds its data on rotating platters with a magnetic upper exterior which are changed or read by electromagnetic tipped arms that move over the disk as it spins.
A memory is just like a human brain. It is used to store data and instructions. The memory is divided into large number of small parts called cells. Each location or cell has a unique address, which varies from zero to memory size minus one. For example, if the computer has 64k words, then this memory unit has 64 * 1024 = 65536 memory locations. The address of these locations varies from 0 to 65535.
Memory is used for storage of data and programs. It is divided into 2 parts.
1)RAM(random access memory) It is the internal memory of the CPU for storing data, program, and program result. It is a read/write memory which stores data until the machine is working. once the machine is switched off, data is erased. RAM is of two types − Static RAM (SRAM) Dynamic RAM (DRAM)
1)SRAM(static RAM) : The word static indicates that the memory retains its contents as long
as power is being supplied.
Characteristic of Static RAM
Long life No need to refresh
Faster
Used as cache memory
Large size
Expensive
High power consumption
2) DRAM(Dynamic Random Access Memory)
DRAM is used for most system memory as it is cheap and small. All DRAMs are made up of memory cells, which are composed of one capacitor and one transistor.
Characteristics of Dynamic RAM
Short data lifetime Needs to be refreshed continuously
Slower as compared to SRAM
Used as RAM
Smaller in size
Less expensive
Less power consumption