To teach the student to write programs in C to solve the problems.
To introduce the student to simple linear data structures such as lists, stacks, queues.
Recommended Systems/Software Requirements:
Intel based desktop PC with ANSI C Compiler and Supporting Editors
Exercise 1:
a) Write a C program to find the sum of individual digits of a positive integer.
b) A Fibonacci sequence is defined as follows: the first and second terms in the sequence are 0 and 1. Subsequent terms are found by adding the preceding two terms in the sequence. Write a C program to generate the first n terms of the sequence.
c) Write a C program to generate all the prime numbers between 1 and n, where n is a value supplied by the user.
Exercise 2:
a) Write a C program to calculate the following Sum:
Sum=1-x 2 /2! +x 4 /4!-x 6 /6!+x 8 /8!-x 10 /10!
b) Write a C program toe find the roots of a quadratic equation
c) Write C programs that use both recursive and non-recursive functions
i) To find the factorial of a given integer.
ii) To find the GCD (greatest common divisor) of two given integers.
iii) To solve Towers of Hanoi problem.
Exercise 3:
a) Write a C program to find both the largest and smallest number in a list of integers.
b) Write a C program that uses functions to perform the following: i) Addition of Two Matrices ii) Multiplication of Two Matrices
c) Write a C program that uses functions to perform the following operations:
i) To insert a sub-string in to a given main string from a given position.
ii) To delete n Characters from a given position in a given string.
d) Write a C program to determine if the given string is a palindrome or not
Exercise 4:
a)Write a C program that displays the position or index in the string S where the string T begins,
or – 1 if S doesn't contain T.
b) Write a C program to count the lines, words and characters in a given text.
c) Write a C program to generate Pascal’s triangle
d)Write a C program to construct a pyramid of numbers.
Exercise 5:
a) Write a C program which copies one file to another.
b)Write a C program to reverse the first n characters in a file.
(Note: The file name and n are specified on the command line.)
c) Write a C programme to display the contents of a file.
d)Write a C programme to merge two files into a third file ( i.e., the contents of the first file followed
by those of the second are put in the third file)
Exercise 6:
Write a C program that uses functions to perform the following operations.:
i) Creation ii) Insertion iii) Deletion iv) Traversal
on
a) singly linked list b) doubly linked list c) circular linked list
Exercise 7:
a) Write C programs that implement stack (its operations) using
i) Arrays ii) Pointers
b)b)Write C programs that implement Queue (its operations) using
i) Arrays ii) Pointers
Exercise 8:
Write a C program that uses Stack operations to perform the following:
i) Converting infix expression into postfix expression
ii) Evaluating the postfix expression
Exercise 9:
Write a C program that implements the following sorting methods to sort a given list of integers in ascending order
i) Bubble sort
ii) Selection sort
Exercise 10:
Write C program that implements the following sorting method to sort a given list of integers in ascending order:
i)Quick sort
ii)Merge sort
Exercise 11:
Write C programs that use both recursive and non recursive functions to perform the following searching operations for a Key value in a given list of integers :
i) Linear search ii) Binary search
Exercise 12:
Write C programs to implement the Lagrange interpolation and Newton- Gregory forward interpolation.
Write C programs to implement the linear regression and polynomial regression algorithms.
Exercise 13:
Write C programs to create BST and perform operations on it.
Write C programs to implement recursive and non recursive Tree traversal techniques.
Exercise 14:
Write C programs to implement Trapezoidal and Simpson methods.
Write C programs to implement Heap Sort.
REFERENCES
Reference Books
1. The Spirit of C, an introduction to modern programming, M.Cooper, Jaico Publishing House.
2. Mastering C, K.R. Venugopal and S.R. Prasad, TMH Publications.
3. Computer Basics and C Programming, V. Rajaraman, PHI Publications