Syllabus

Course Code: EI-PRES-04    Course Name: Computer programming Lab

MODULE NO / UNIT COURSE SYLLABUS CONTENTS OF MODULE NOTES
1 Write a C program to compute roots of quadratic equation ax2+bx+c=0, where a, b, and c are three coefficients of a quadratic equation are inputs.
2 Design and develop an algorithm to find the reverse of an integer number.
3 Design and develop an algorithm to check whether given number is PALINDROME or NOT, Implement a C program for the developed algorithm that takes an integer number as input and output the reverse of the same with suitable messages. Ex: Num: 2019, Reverse: 9102, Not a Palindrome.
4 Design and develop a c program to implement simple calculator using switch case statement.
5 Draw the flowchart and Write a C Program to compute Sin(x) using Taylor series approximation given by Sin(x) = x - (x3/3!) + (x5/5!) - (x7/7!) + …….
6 Develop, implement and execute a C program to search a Number in a list using linear searching Technique.
7 Develop an algorithm, implement and execute a C program that reads N integer numbers and arrange them in ascending order using Bubble Sort.
8 Design and develop a C program to read and print a matrix and check whether a given Matrix is a sparse Matrix or not.
9 Design and develop a C program to read and print a matrix and check whether a given Matrix is a sparse Matrix or not.
10 a. Write a C program to implements the following string manipulation functions till the use wishes to continue (infinite loop): (i) strcpy() (ii) srrlen() (iii) strrev () (iv) strcmp() (v) strcat(). b. Read a sentence and print frequency of vowels and total count of consonants.
11 Design and develop a C function RightRotate (x, n) that takes two integers x and n as input and returns value of the integer x rotated to the right by n positions. Assume the integers are unsigned.
12 Draw the flowchart and write a recursive C function to find the factorial of a number, n!, define by fact(n)=1, if n=0. Otherwise fact (n) =n*fact (n-1). Using this function, write a C program to compute the binomial coefficient nCr. Tabulate the results for different values of n and r with suitable messages
13 Given two university information files such as “studentname.txt” and “usn.txt” that contains students Name and USN respectively. Write a C program to create a new file called “output.txt” and copy the content of files
“studentname.txt” and “usn.txt” into output file in the sequence shown below.
Display the contents of output file “output.txt” on to the screen.
Student Name     USN
Name 1     USN1
Name 2     USN2…. ….
14 a. Write a C program to maintain a record of n student details using an array of structures with four fields (Roll number, Name, Marks, and Grade). Assume appropriate data type for each field. Input & Print the members of the structure
b. Write a C program to take 2 structures HH:MM: SS as T1 & T2 & display the time difference as structure as T3.
15 Write a C program using pointers to compute the sum, mean and standard deviation of all elements stored in an array of n real numbers.
Copyright © 2020 Kurukshetra University, Kurukshetra. All Rights Reserved.