You are on page 1of 11

Lovely Professional University, Punjab

Course Code Course Title Course Planner Lectures Tutorials Practicals Credits
CSE104 COMPUTER PROGRAMMING LABORATORY 11266::Janpreet Singh 0.0 0.0 2.0 1.0
Course Orientation 3 :SOFTWARE SKILL, 5 :PLACEMENT EXAMINATION, 6 :PLACEMENT EXAMINATION(Mass Recruiters), 7 :COMPETITIVE
EXAMINATION(Higer Education)

TextBooks
Sr No Title Author Edition Year Publisher Name
T-1 PROGRAMMING IN C ASHOK N. KAMTHANE 2nd 2011 PEARSON
Reference Books
Sr No Title Author Edition Year Publisher Name
R-1 PROGRAMMING WITH C BYRON GOTTFRIED 3rd 2011 MCGRAW HILL EDUCATION
R-2 PROGRAMMING IN ANSI C E. BALAGURUSAMY 6th 2012 MCGRAW HILL EDUCATION

Other Reading

Sr No Journals articles as Compulsary reading (specific articles, complete reference)


OR-1 http://www.cprogrammingexpert.com/C/introduction_to_c_programming_language.aspx ,
OR-2 http://www.cprogramming.com/tutorial/c-tutorial.html ,
OR-3 http://www.tutorialspoint.com/cprogramming/index.htm ,
OR-4 http://www.cquestions.com/2010/07/c-program-examples.html ,
OR-5 http://www.programiz.com/c-programming/ ,

Relevant Websites
Sr No Web address (only if relevant to the course) Salient Features
RW-1 http://www.c-lang.thiyagaraaj.com/tutorials/c-controls/c-data-input-and-data-output C Data Input and Data Output

RW-2 http://www.c-lang.thiyagaraaj.com/tutorials/c-controls/c-operators C Operators

RW-3 http://www.programiz.com/c-programming/c-decision-making-loops-examples C Flow Control

RW-4 http://www.programiz.com/c-programming/c-input-output C Programming Input Output (I/O)

RW-5 http://www.learn-c.org/en/Functions Functions

RW-6 http://www.tutorialspoint.com/cprogramming/c_recursion.htm Recursion

RW-7 http://www.tutorialspoint.com/cprogramming/c_arrays.htm Arrays

RW-8 http://www.tutorialspoint.com/cprogramming/c_strings.htm Strings


RW-9 http://www.cs.cf.ac.uk/Dave/C/node10.html Pointers

RW-10 http://www.programiz.com/c-programming/c-dynamic-memory-allocation Dynamic memory management

RW-11 http://www.exforsys.com/tutorials/c-language/c-structures-and-unions.html Structures and Unions

RW-12 http://www.programiz.com/c-programming/c-file-input-output File management

RW-13 http://www.sanfoundry.com/c-programming-examples/ Programming examples using Array,String,File Handling,Mathematical


Functions, Puzzles & Games ,Recursion and Bitwise Operations
RW-14 http://www.programiz.com/c-programming/examples Programming Examples

RW-15 http://www.c4learn.com/c-programs/ Porgramming Examples

Audio Visual Aids


Sr No AV aids (only if relevant to the course) Salient Features
AV-1 http://www.learnerstv.com/Free-Computer-Science-Video-lectures-ltv040-Page1.htm Free Audio and Video lectures on C laguage.

Software/Equipments/Databases

Sr No S/E/D (only if relevant to the course) Salient Features


SW-1 DEV C++ A compiler and integrated development environment for formulation of C
programs
Virtual Labs
Sr No VL (only if relevant to the course) Salient Features
VL-1 http://cse02-iiith.vlabs.ac.in Computer programming Virtual Lab of IIIT HYDERABAD
VL-2 http://atulgosai.mdl2.com/mod/url/view.php?id=15 List of experiments related to C programming

Scheme for CA:


Component Frequency Out Of Each Marks Total Marks
Practical Evaluation 3 4 10 30

Total :- 10 30

Details of Academic Task(s)


AT No. Objective Topic of the Academic Task Nature of Academic Task Evaluation Mode Allottment /
(group/individuals/field submission Week
work
Practical To ensure Practical Evaluation 1 will cover the topics of week1 and week2 Individual Depends on the 1/3
Evaluation1 understanding of the practical attempted
concepts and check by the student based
the student's on execution and
progress and his viva
performance on
individual basis
Practical To ensure Practical Evaluation 1 will cover the topics of week3,week4 and Individual Depends on the 4/6
Evaluation2 understanding of the week5 practical attempted
concepts and check by the student based
the student's on execution and
progress and his viva
performance on
individual basis
Practical To ensure Practical Evaluation 3 will cover the topics of week6,week7 and Individual Depends on the 7/9
Evaluation3 understanding of the week8 practical attempted
concepts and check by the student based
the student's on execution and
progress and his viva
performance on
individual basis
Practical To ensure Practical Evaluation 4 will cover the topics of week9,week10 and Individual Depends on the 10 / 12
Evaluation4 understanding of the week11 practical attempted
concepts and check by the student based
the student's on execution and
progress and his viva
performance on
individual basis

*Each experiment of the lab will be evaluated using following relative scheme:
Component % of Marks
J/E 50
VIVA 50

Detailed Plan For Practicals


Practical No Broad topic (Subtopic) Practical Description Learning Outcomes Equipment Used
Practical 1 Variables, Constants, Operators, Write a C program that asks the user to Students will learn about the usage of Dev-Cpp
Control statements(C programming enter a 10-digit telephone number (the first various operators.
exercises involving the use of variables, three digits refer to the area code, the next
Constants, Arithmetic, Relational, three digits refer to the exchange code, and
Logical and Bit-wise operators) the remaining four digits refer to number),
print the parts of the number and complete
telephone number in addition to the area
code and exchange code.P1 is also reserved
for the introduction of course, CA
weightage,exam pattern etc.
Practical 2 Variables, Constants, Operators, Write a program to swap 2 variables with Students will learn about the usage of Dev-Cpp
Control statements(C programming the use of third variable or without the use various operators,control strucutres.
exercises involving the use of looping of third variable.
constructs (while, Do while and for), Write a program to calculate the factorial of
Selection and multi selection (if, Else, a positive integer number.
Switch), Break, Continue, Goto Write a program to multiply 2 numbers
statements) without using * operator.

Write a program to generate the first n


terms of the Fibanocci sequence and
generate all the prime numbers between 1
and n, where n is a value supplied by the
user. P3 is also reserved for first lab
evaluation.
Practical 3 Variables, Constants, Operators, Write a program to swap 2 variables with Students will learn about the usage of Dev-Cpp
Control statements(C programming the use of third variable or without the use various operators,control strucutres.
exercises involving the use of looping of third variable.
constructs (while, Do while and for), Write a program to calculate the factorial of
Selection and multi selection (if, Else, a positive integer number.
Switch), Break, Continue, Goto Write a program to multiply 2 numbers
statements) without using * operator.

Write a program to generate the first n


terms of the Fibanocci sequence and
generate all the prime numbers between 1
and n, where n is a value supplied by the
user. P3 is also reserved for first lab
evaluation.
Practical 4 Formatted and unformatted Write a C program to implement formatted Students will learn how to use certain Dev-Cpp
Input/Output functions, User defined functions like printf() with format flag inbuilt functions.
functions, Recursive functions(writing modifiers, justication,padding and sign flag.
C programs using formatted and Write a program to enter a string and
unformatted functions such as scanf(), display it using getch() and putchar
printf(), getch(), getche(), getchar(), functions.
gets(), puts()) Write a C program to find the sum of digits
of a number entered through the keyboard.
Write C programs which use both recursive
and non-recursive functions.
Write a C program to find the factorial of a
given integer.
Write a C program to find the GCD
(greatest common divisor) of two given
integers.

Practical 5 Formatted and unformatted Write a program which is capable of finding Students will learn about the use of Dev-Cpp
Input/Output functions, User defined the gcd of a number using a recursive recursive functions.
functions, Recursive functions(writing function.
C programs using user defined Write a program which is capable of finding
functions, library functions in math.h, the number is palindrome or not using a
recursive functions) recursive function.
Write a program which is capable of finding
the number is prime or not using a recursive
function.
Write a program which is capable of finding
the sum of digits of a number using a
recursive function.
Practical 6 One dimensional and two dimensional Write a program which is capable of Students will learn about the operations of Dev-Cpp
arrays(writing C programs using 1D, searching an element into set of elements. arrays(set of elements).
2D arrays) Write a program which is capable of finding
the average of elements using set of
elements.
Write a program which is capable of finding
maximum-value and minimum-value
element into set of elements.
Write a program which is capable of finding
the sum of 2-D matrices.
Write a program which is capable of finding
the sum of diagonal elements of 2-D
matrices.
Write a program which is capable of finding
the multiplication of 2-D matrices.
P6 is also reserved for second practical
evaluation.
Practical 6 One dimensional and two dimensional Write a program which is capable of Students will learn about the operations of Dev-Cpp
arrays(operations on arrays) searching an element into set of elements. arrays(set of elements).
Write a program which is capable of finding
the average of elements using set of
elements.
Write a program which is capable of finding
maximum-value and minimum-value
element into set of elements.
Write a program which is capable of finding
the sum of 2-D matrices.
Write a program which is capable of finding
the sum of diagonal elements of 2-D
matrices.
Write a program which is capable of finding
the multiplication of 2-D matrices.
P6 is also reserved for second practical
evaluation.
One dimensional and two dimensional Write a program which is capable of Students will learn about the operations of Dev-Cpp
arrays(C programming exercises searching an element into set of elements. arrays(set of elements).
involving assigning of values and Write a program which is capable of finding
manipulation of integer, float and the average of elements using set of
character arrays) elements.
Write a program which is capable of finding
maximum-value and minimum-value
element into set of elements.
Write a program which is capable of finding
the sum of 2-D matrices.
Write a program which is capable of finding
the sum of diagonal elements of 2-D
matrices.
Write a program which is capable of finding
the multiplication of 2-D matrices.
P6 is also reserved for second practical
evaluation.
Practical 7 One dimensional and two dimensional Write a program which is capable of pass Students will learn about the sorting Dev-Cpp
arrays(passing arrays to functions) the array as argument of user defined operations of array elements.
function.
Write a program which is capable of sort
the array elements in the ascending or
descending order with the use of bubble
sort.

One dimensional and two dimensional Write a program which is capable of pass Students will learn about the sorting Dev-Cpp
arrays(sorting of arrays using bubble the array as argument of user defined operations of array elements.
sort) function.
Write a program which is capable of sort
the array elements in the ascending or
descending order with the use of bubble
sort.
Practical 8 String, String functions, Sorting and Write a C program to find the length of Students will learn about the usage of Dev-Cpp
searching in string(writing C programs string without using library function. basic operations with strings.
on strings, array of strings, library Write a C program to combine 2 strings into
functions in string.h) single string without using library function.
Write a C program which contains a
function which behaves like the strcmp
function and is capable of determining if
two strings are equal or not.
Write a C program to sort an array of
strings alphabetically.
Write a C program to search any character
into string.
Write a C program to count vowels and
consonants of a sentence.

String, String functions, Sorting and Write a C program to find the length of Students will learn about the usage of Dev-Cpp
searching in string(writing C programs string without using library function. basic operations with strings.
to check whether a string is a Write a C program to combine 2 strings into
palindrome or not) single string without using library function.
Write a C program which contains a
function which behaves like the strcmp
function and is capable of determining if
two strings are equal or not.
Write a C program to sort an array of
strings alphabetically.
Write a C program to search any character
into string.
Write a C program to count vowels and
consonants of a sentence.

String, String functions, Sorting and Write a C program to find the length of Students will learn about the usage of Dev-Cpp
searching in string(C programming string without using library function. basic operations with strings.
exercises to insert and delete n Write a C program to combine 2 strings into
characters from a given position in a single string without using library function.
string) Write a C program which contains a
function which behaves like the strcmp
function and is capable of determining if
two strings are equal or not.
Write a C program to sort an array of
strings alphabetically.
Write a C program to search any character
into string.
Write a C program to count vowels and
consonants of a sentence.
Practical 8 String, String functions, Sorting and Write a C program to find the length of Students will learn about the usage of Dev-Cpp
searching in string(C programming string without using library function. basic operations with strings.
exercises to count the words and Write a C program to combine 2 strings into
characters in a given line of text) single string without using library function.
Write a C program which contains a
function which behaves like the strcmp
function and is capable of determining if
two strings are equal or not.
Write a C program to sort an array of
strings alphabetically.
Write a C program to search any character
into string.
Write a C program to count vowels and
consonants of a sentence.

String, String functions, Sorting and Write a C program to find the length of Students will learn about the usage of Dev-Cpp
searching in string(writing C programs string without using library function. basic operations with strings.
involving searching and sorting of Write a C program to combine 2 strings into
strings) single string without using library function.
Write a C program which contains a
function which behaves like the strcmp
function and is capable of determining if
two strings are equal or not.
Write a C program to sort an array of
strings alphabetically.
Write a C program to search any character
into string.
Write a C program to count vowels and
consonants of a sentence.

Practical 9 Pointers(writing C programs to locate Write a C program to find out sum of array Students will learn about the usage of Dev-Cpp
basic data type variables using pointers) elements using pointers. Write a C program pointers.
to demonstrate the arithmetic operations on
pointers. Write a C program which is
capable of finding the average of array
elements using pointers.P9 is also reserved
for third lab evaluation.
Pointers(pointer to pointer) Write a C program to find out sum of array Students will learn about the usage of Dev-Cpp
elements using pointers. Write a C program pointers.
to demonstrate the arithmetic operations on
pointers. Write a C program which is
capable of finding the average of array
elements using pointers.P9 is also reserved
for third lab evaluation.
Practical 10 Pointers(pointer to arrays) Students will learn about the usage of Dev-Cpp
Write a C program which is capable of pointers.
searching into array elements using
pointers. Write a C program which is
capable of finding maximum-value and
minimum-value array elements using
pointers. Write a program which is capable
of sort the array elements in the ascending
or descending order with the use of
pointers. Write a C program to process
string elements using pointers.

Pointers(pointer to string) Students will learn about the usage of Dev-Cpp


Write a C program which is capable of pointers.
searching into array elements using
pointers. Write a C program which is
capable of finding maximum-value and
minimum-value array elements using
pointers. Write a program which is capable
of sort the array elements in the ascending
or descending order with the use of
pointers. Write a C program to process
string elements using pointers.

Pointers(returning pointer from Students will learn about the usage of Dev-Cpp
function) Write a C program which is capable of pointers.
searching into array elements using
pointers. Write a C program which is
capable of finding maximum-value and
minimum-value array elements using
pointers. Write a program which is capable
of sort the array elements in the ascending
or descending order with the use of
pointers. Write a C program to process
string elements using pointers.

Practical 11 Dynamic Memory Allocation(writing C Write a C program which allocates enough Students will learn how the program can Dev-Cpp
programs to implement dynamic memory to read a string, read in another be written with proper memory
memory management using malloc(), string and replace the occurrence of the management.
calloc(), realloc(), free() functions) second string from the first one with the
words "Sample". Please makeuse of
appropriate functions such as malloc to
allocate memory dynamically for both the
strings, realloc to adjust the memory
allocated to the first string, free to free up
the memory allocated to the second string.
Practical 12 Structures and Unions(writing C Write a C program which has Students will learn about the usage of Dev-Cpp
programs using structures and unions) a structure structure and union.
to store the id, name, gender, address and
salary of the employee and the program
should contain functions to input, display
and search for a particular employee.Write
a C program which has a structure
within a structure and display the contents
of structure elements.P12: Reserved for
fourth lab evaluation.
Structures and Unions(writing C Write a C program which has Students will learn about the usage of Dev-Cpp
programs using nested structures) a structure structure and union.
to store the id, name, gender, address and
salary of the employee and the program
should contain functions to input, display
and search for a particular employee.Write
a C program which has a structure
within a structure and display the contents
of structure elements.P12: Reserved for
fourth lab evaluation.
Practical 13 File handling(writing C programs to Write a C program to copy one file into Students will learn about the usage of file Dev-Cpp
read and write in to text and binary files another file. handling and macro #define and #include
opened with different modes) Write a C program to convert the contents
of a file in upper case and write the contents
in another file.
Write a C program which reads the data
present in a file, replaces it with some other
data which is entered from the keyboard in
the file.
Write a C program to create a macro to
swap 2 values with each other.
Write a C program to create a macro with
constant value pi=3.14

File handling(writing C programs to Write a C program to copy one file into Students will learn about the usage of file Dev-Cpp
append to the data present in the files) another file. handling and macro #define and #include.
Write a C program to convert the contents
of a file in upper case and write the contents
in another file.
Write a C program which reads the data
present in a file, replaces it with some other
data which is entered from the keyboard in
the file.
Write a C program to create a macro to
swap 2 values with each other.
Write a C program to create a macro with
constant value pi=3.14
Practical 14 The C Preprocessor(explaining the Write a C program to copy one file into Students will learn about the usage of file Dev-Cpp
concept of C preprocessor directives another file. handling and macro #define and #include.
with #define) Write a C program to convert the contents
of a file in upper case and write the contents
in another file.
Write a C program which reads the data
present in a file, replaces it with some other
data which is entered from the keyboard in
the file.
Write a C program to create a macro to
swap 2 values with each other.
Write a C program to create a macro with
constant value pi=3.14

SPILL OVER
Practical 15 Spill Over

You might also like