{{{credits}}}
L | T | P | C |
2 | 0 | 2 | 3 |
- To use basic programming concepts of C
- To develop programs using loops, functions, arrays, pointers, strings, structures and files.
{{{unit}}}
UNIT I | BASICS | 6 |
Algorithm – Structure of a C program – Data Types: built-in, user-defined – Variables and constants – Input and output statements – Operators, expressions, and assignment statements – Control statements.
{{{unit}}}
UNIT II | FUNCTIONS | 6 |
Function prototype – Function definition and call – Passing parameters – Built-in functions – Recursion.
{{{unit}}}
UNIT III | ARRAYS AND POINTERS | 6 |
Arrays: Declaration, initialization – One-dimensional arrays – Multi-dimensional arrays; Pointers: Pointer operators – Pointer operations – Array of pointers – Passing arrays to functions.
{{{unit}}}
UNIT IV | STRINGS, STRUCTURES AND UNIONS | 6 |
Strings: Constants and variables, reading and writing strings, string operations, string library; Command line arguments; Structures: Structures and functions – Array of structures – Pointer to a structure – unions; Dynamic memory allocation.
{{{unit}}}
UNIT V | FILES | 6 |
Files: opening and closing a data file – Creating a data file – Processing a data file – Unformatted data files – Formatted input and output – Line input and output – File error handling.
\hfill Theory Periods: 30
- Program using I/O statements, conditional constructs (if, switch, ternary) and looping constructs (for, while, do-while)
- Program functions with different parameter passing techniques: Call by value, call by reference (e.g. changing the elements of an array)
- Program one dimensional arrays (e.g. Insertion sort)
- Program using strings and their operations (e.g. concatenation of strings, extracting a substring, checking for palindrome)
- Program to demonstrate simple structure manipulations (e.g. generating a transcript with CGPA and class obtained)
- Programs to demonstrate file operations (e.g. count the number of characters, words and lines in a file).
\hfill Practical Periods: 30
\hfill Total Periods: 60
After the completion of this course, students will be able to:
- Understand the basic programming constructs in C (K2)
- Write functions in C (K2)
- Develop C programs using arrays and pointers (K3)
- Write programs using strings and structures (K3)
- Do operations with files in C (K2).
- Byron Gottfried, “Programming with C”, (Schaum’s Outlines Series), McGraw-Hill Education, 3rd Edition, 2017.
- Brian W Kernighan, Dennis M Ritchie, “The C Programming Language”, Pearson Education India, 2nd Edition, 2015.
- Reema Thareja, “Programming in C”, Oxford University Press, 2nd Edition, 2016.
- Yashwant Kanetkar, “Let Us C”, BPB Publications, 14th Edition, 2016.
- King K N, “C Programming: A Modern Approach”, W. W. Norton & Company, 2nd Edition, 2008.
- Herbert Schildt, “C The Complete Reference”, McGraw Hill Education, 4th Edition, 2017.
- Stephen G Kochan, “Programming in C”, 3rd edition, Pearson Ed, 2004.