COMP1
COMP1
I/O functions: Header files (stdio.h, conio.h) getch(), getche(), getchar(), putch(), putchar(),
scanf(), printf(), gets(), puts(), clrscr()
Control statements: Decision making and branching (if..else, switch); looping (while, do .. while,
for), Jumping (break, continue, goto), Nested loops.
Arrays and Pointers: Defining an array, array initialization, processing an array, passing array to
a function, multidimensional arrays, pointer declarations, passing pointer to a function, pointer
and one dimensional arrays, Operation on pointers, Memory allocation functions (malloc(),
calloc(), free()).
Structures and Unions: Defining a structure, processing a structure, user defined data types,
array of structures, structures and pointers, passing structures to a function, self-referential
structures, Union, Union of structures, Enumeration, typedef
Data structure fundamentals: Data Type, Abstract Data Type, Data Structure. Linked List as a
data structure (characteristics, advantages, disadvantages); operations on lists (creation, insertion,
deletion, traversal); types of linked list - singly linked list, doubly linked list, circular list.
Stacks and Queues: Introduction to stacks and queues, Operations on stacks and queues,
Implementation of stacks and queues using static arrays and linked lists; Definitions of Circular
Queue, Priority Queue (definition only) , D-Queue (definition only) ; Application of stacks:
Conversion of infix(containing arithmetic operators including exponential operator, and
parenthesis) to postfix, evaluation of postfix expression.
Searching and Sorting: Linear search and Binary search algorithms, Bubble sort and Insertion
sort algorithms
UNIT – IV: Practical
BASIC Practical:
4. Write a program that will read the value of x and evaluate the following function
1 for x>0
Y= 0 for x=0
-1 for x<0
Using
(a) nested if statements,
(b) else if statements, and
(c) Conditional operator?:
5. Write a program to calculate the monthly telephone bill according to the following rules:
(a) Rural subscribers:
Text :
References :
1. Byron S. Gottfried, Theory and Problems of Programming with C, Tata McGraw Hill
Publication
2. Brian Kernighan and Dennis M. Ritchie, C Programming Language, 2nd Edition, PHI
3. Y. Langsam, M.J. Augenstein, A.M. Tenenbaum, Data Structures Using C and C++,
Second Edition, Prentice Hall of India, 2000
4. Reema Thareja, Data Structures Using C, 2nd Edition, Oxford University Press, India