Programming in ‘C’

 Course Objectives:

  1. To impart basic knowledge about simple algorithms for arithmetic and logical problems so that students can understand how to write a program, syntax and logical errors in ‘C’.
  2. To impart knowledge about how to implement conditional branching, iteration and recursion in ‘C’.
  3. To impart knowledge about using arrays, pointers, files, union and structures to develop algorithms and programs in ‘C’.
  4. To impart knowledge about how to approach for dividing a problem into sub-problems and solve the problem in ‘C’.

Course Outcomes (CO):

  • CO1 Ability to develop simple algorithms for arithmetic and logical problems and implement them in ‘C’.
  • CO2 Ability to implement conditional branching, iteration and recursion and functions in ‘C’
  • CO3 Ability to use arrays, pointers, union and structures to develop algorithms and programs in ‘C’.
  • CO4 Ability to decompose a problem into functions and synthesize a complete program using divide and conquer approach in ‘C’.

Unit I
Introduction to Programming: Computer system, components of a computer system, computing environments, computer languages, creating and running programs, Preprocessor, Compilation process, role of linker, idea of invocation and execution of a programme. Algorithms: Representation using flowcharts, pseudocode.
Introduction to C language: History of C, basic structure of C programs, process of compiling and running a C program, C tokens, keywords, identifiers, constants, strings, special symbols, variables, data types, I/O statements. Interconversion of variables.
Operators and expressions: Operators, arithmetic, relational and logical, assignment operators, increment and decrement operators, bitwise and conditional operators, special operators, operator precedence and associativity, evaluation of expressions, type conversions in expressions.

Unit II
Control structures: Decision statements; if and switch statement; Loop control statements: while, for and do while loops, jump statements, break, continue, goto statements.
Arrays: Concepts, One dimensional array, declaration and initialization of one dimensional arrays, two dimensional arrays, initialization and accessing, multi-dimensional arrays.
Functions: User defined and built-in Functions, storage classes, Parameter passing in functions, call by value, Passing arrays to functions: idea of call by reference, Recursion.
Strings: Arrays of characters, variable length character strings, inputting character strings,character library functions, string handling functions. 

Unit III
Pointers: Pointer basics, pointer arithmetic, pointers to pointers, generic pointers, array of pointers, functions returning pointers, Dynamic memory allocation. Pointers to functions. Pointers and Strings
Structures and unions: Structure definition, initialization, accessing structures, nested structures, arrays of structures, structures and functions, self-referential structures, unions, typedef, enumerations.
File handling: command line arguments, File modes, basic file operations read, write and append. Scope and life of variables, multi-file programming.

Unit IV
Pre-processor Directives: #, ##, #define, #if, #indef, #ifdef, #if ... #else.
‘C’ Standard Libraries: stdio.h, stdlib.h, assert.h, math.h, time.h, ctype.h, string.h, stdarg.h. C99 extensions.
Basic Algorithms: Finding Factorial, Fibonacci series, Linear and Binary Searching, Basic Sorting 
Algorithms- Bubble sort, Insertion sort and Selection sort. Find the square root of a number, array order reversal, reversal of a string

Textbooks:
1. How to solve it by Computer by R. G. Dromey, Prentice-Hall India EEE Series, 1982.
2. The C programming language by B W Kernighan and D M Ritchie, Pearson Education, 1988.

References:
1. Programming Logic & Design by Tony Gaddis, Pearson, 2nd Ed. 2016.
2. Programming Logic and Design by Joyce Farrell, Cengage Learning, 2015.
3. Engineering Problem Solving With C by Delores M. Etter, Pearson, 2013.
4. Problem Solving and Program Design in C by Jeri R. Hanly and Elliot B. Koffman, Pearson, 2016.
5. Structure and Interpretation of Computer Programs by Harold Abelson and Gerald Sussman with Julie Sussman, MIT Press, 1985.
6. How to Design Programs by Matthias Felleisen, Robert Bruce Findler, Matthew Flatt, and Shriram Krishnamurthi, MIT Press, 2018.
7. ANSI/ISO 9899-1990, American National Standard for Programming Languages ‘C’ by American National Standards Institute, Information Technology Industry Council, 1990 (C89).
8. ISO/IEC 9899:1999. International Standard for Programming Languages – C (ISO/IEC 9899) by American National Standards Institute, Information Technology Industry Council, 2000 (C99).
9. INCITS/ISO/IEC 9899-2011.American National Standard for Programming Languages ‘C’ by American National Standards Institute, Information Technology Industry Council, 2012 (C11).

No comments:

Post a Comment