ChE106 COMPUTER PROGRAMMING WITH C

Lectures: 3 Periods/Week Sessional Marks: 30
University Exam: 3 Hours University Examination Marks: 70


UNIT-I

Introduction: Computer Fundamentals: Computer & its Components, Hardware/Software, Algorithm, Characteristics of algorithm, Flowchart, Symbols are used in flowchart, history of C, Basic structure of C, C language features.
C Tokens: Character set, Variables, Keywords, Data types and sizes, Type qualifiers, Numeric Constants and their forms of representation, Character Constants, String Constants, Declarations and Initialization of variables.
Operators & Expressions: Arithmetic operators, and expressions, Type-conversion rules, Coercion, Assignment operators and expressions, Increment and decrement operator, Conditional operator, Statements, Preprocessor directives, Input/ Output functions and other library functions. Relational operators and expressions. Boolean operators and expressions.
Programming Exercises: C-Expressions for algebraic expressions, Evaluation of arithmetic and boolean expressions. Syntactic errors in a given program, Output of a given program, Values of variables at the end of execution of a program fragment, Filling the blanks in a given program, Computation of values using scientific and Engineering formulae, Finding the largest of three given numbers. >

UNIT-II

Conditional Statements: Blocks, If-Else statement, Else-lf statement and Switch statement.
Iterative Statements: While loop, For loop, Do-While loop, Break, and continue.
Arrays: One-dimensional and character arrays, Two-dimensional numeric arrays.
Programming Exercises Computation of discount on different types of products with different ranges of discount Finding the type of triangle formed by the given sides, Computation of income-tax, Computation of Electricity bill, Conversion of lower case character to its upper case, Finding the class of an input character; Sum of the digits of a given number, Image of a given number, To find whether a given number is-prime; Fibonacci; abundant; perfect, Strong, Amstrong; deficient, Prime factors of a given number, Merging of lists, Transpose of a matrix, Product and sum of matrices, String processing, length of a string, comparison of strings, reversing a string, copying a string, Sorting of names using arrays, Graphics patterns, to print prime numbers and Fibonacci numbers in a given range and Amicable numbers.

UNIT-III

Functions: Function Definition, types of User Defined Functions, Parameter passing mechanisms, and simple recursion.
Scope & extent: Scope rules, Storage Classes, Multi-file compilation.
Pointers: Pointers Arithmetic, Character array of pointers, Dynamic memory allocation, array of Pointer, Pointer to arrays.

Programming Exercises

Recursive Functions: Factorial, GCD (Greatest Common Divisor), Fibonacci, to evaluate the pointer arithmetic expressions; An interactive program to perform Pointers & Functions - Insertion sort, Bubble sort, Linear search Binary search, Computation of Statistical parameters of a given list of numbers, Counting the number of characters, words and lines in a given text, Table of values of f (x,y) varying x and y; Using Storage Classes to implement the multifile compilation; implement the string operations using Dynamic memory allocation functions;

UNIT-IV

Structures: Structures, Array of structures, structures within structures, Pointer to structures, self referential structures, Unions. Files: File Handling functions, File error handling functions, Command-line arguments.

Programming Exercises

Operations on complex numbers, operations on rational number (p/q form), Matrix operations with size of the matrix as a structure, Frequency count of keywords in an input program, Sorting a list of birth records on name and date of birth using File handling functions, Student marks processing, Library records processing, sorting on name, author, Copy one file to another.

Text Books
  1. Programming with C (Schaum's Outlines), Byron Gottfried, Tata McGraw-Hill.

Reference Books
  1. The C programming language, Kernighan B W and Ritchie O M, Prentice Hall.
  2. Programming with C, K R Venugopal & Sudeep R Prasad, Tata McGraw-Hill.
  3. C Programming, K.Balaguruswamy, BPB
  4. C Complete Reference, Herbert Sheildt, Tata McGraw-Hill