SEMESTER - I
St. Xavier’s College (Autonomous), Ahmedabad
Syllabus of Semester – I of the following departments under Faculty of
Computer Science based on Undergraduate Curriculum Framework to be
implemented from the Academic Year 2024-25.
DEPARTMENT OF COMPUTER SCIENCE
BCS CS (Hons.)
Category – IV
Major – 1: Introduction to Programming and Algorithm using C (CS-1501)
CREDIT DISTRIBUTION, ELIGIBILITY AND PRE-REQUISITES OF THE COURSE
Course Title & Credit Distribution of The Eligibility Criteria Prerequisite(s) of
Code Course the Course (if any)
Lecture Tutorial Activity/Case
study
analysis
Introduction to 4 0 0 10 + 2 from a
Programming recognized board in
and Algorithm any stream
using C
CS-1501
Learning Objectives
This interdisciplinary course is designed to provide an understanding of the C
programming language which helps to understand the technical logic. The attempt is to
facilitate the students analyze the logical skills and generate interest in technical side of
the country.
Syllabus of CS-1501 Introduction to Programming and Algorithm using C
Unit-1: Fundamentals of Programming Techniques and C language Operators and
Decision Making
15 Hours
Introduction to Programming Languages: Introduction to Machine level language,
Assembly language, High- level language, Limitations and Features - Classification of
Computer Language - Procedural Language and Non- Procedural Language.
Introduction of C Language: History of C, Basic Structure of C, Executing C program,
Character set & C Tokens, Identifiers & Keywords, Data Types, Storage Class, Constants
and Variables, Type Casting, Comments
Console based I/O and related built-in I/O function: Formatted functions: printf(), scanf() -
Unformatted functions: getch(), getchar(), putchar(), getche( ), putch(), gets(), puts() -
Concept of Header files and #include, #define
Operators & Expression: Types of Operators and Expression, Precedence & Associativity
- Decision Making Structure-If, If-else, Nested If-else, Switch
Unit-2: Control Structure, Array, String & User Defined Functions 15 Hours
Loop Control Structure: While, Do-While, For, Nested loop
Other Statements: break, continue, goto, exit
Array: One, Two-Dimensional Arrays, Initialization and working with Array, Introduction to
Multidimensional Arrays
Character Arrays and Strings: Initialization and working with String, Comparing and String
Handling functions.
User Defined Functions: Introduction of UDF - Elements of UDF - Categories of UDF: No
argument no return value , Arguments but no return value, No argument but returns a
value, Arguments with return value, Recursion, Nesting Function, Variable Scope,
Visibility and lifetime in function,
Storage Classes
Unit-3: Structures, Unions, Pointer 15 Hours
Structures: Defining a structure, Declaring structure variables, Accessing a structure
variable, Structure Initialization, Operations on structure members, Copying and
comparing variables, Arrays of structure-Arrays within Structures-Structure within
structure
Unions: Defining Unions
Pointer: Definition and Concept, Advantage of using pointer, Chain of Pointers, Null
Pointer, Pointer Arithmetic-Pointer and character strings, Array of Pointers-Pointers and
Functions-Pointers and Structures
Unit-4: Dynamic Memory Allocation, Link List & Files 15 Hours
Dynamic Memory Allocation: Dynamic Memory Allocation Concept, Memory Allocation
Function- malloc(), calloc() and realloc(), free()
Linked List: Concepts of Linked List-Advantages, Applications of Linked list, Overview of
types of Linked list, Operations on Singly Linked List: Create And Display Linked List,
Insert at first, Insert at last, Insert before/after a specific node, Delete at first, Delete at
last-Delete a specific node, Traversal
Files: Concepts of File Management, Files Functions, fopen(), fclose(), fprintf(), fscanf(),
fseek(), ftell(), rewind(),putc(),getc(),putw(),getw(),Error handling functions
Preprocessors: Types of Preprocessors, Macro substitution directives, File inclusion
directives, Compiler control directives.
Essential / Recommended Readings:
• Programming in ANSI C. (6th Ed.) – Balagurusami - Tata McGraw Hill
Publication
• Programming In C (2nd Ed.) - Ashok N. Kamthane - Pearson Education
Suggestive Readings:
• The C Programming Language - DENNIS M. RITCHIE- AT&T Bell
LaboratoriesMurray Hill, New Jersey
• Let us C – (15th Ed.) - Yashwant Kanetkar - BPB Publications
• Programming in C - Reema Thareja - Oxford University Press
St. Xavier’s College (Autonomous), Ahmedabad
Syllabus of Semester – I of the following departments under Faculty of
Computer Science based on Undergraduate Curriculum Framework to be
implemented from the Academic Year 2024-25.
DEPARTMENT OF COMPUTER SCIENCE
BCS CS (Hons.)
Category – IV
Major-2: Introduction to Programming and Algorithm using C – Practical(CS-
1502L)
CREDIT DISTRIBUTION, ELIGIBILITY AND PRE-REQUISITES OF THE COURSE
Course Title & Credit Distribution of The Eligibility Criteria Prerequisite(s) of
Code Course the Course (if any)
Lecture Tutorial Practical
Introduction to 0 0 8 10 + 2 from a
Programming and recognized board in
Algorithm using C any stream
- practical
Learning Objectives
This interdisciplinary course is designed to provide an understanding of the C
programming language which helps to understand the technical logic . The attempt is to
facilitate the students analyze the logical skills and generate interest in technical side of
the country.
Syllabus of CS-1502L
Unit-1 Fundamentals of Programming Techniques and C language Operators and Decision
Making: (30 Hours)
1. Find the Simple Interest. Inputs are principal amount, period in year and rate of interest.
2. Find the area and perimeter of square and rectangle. Input the side(s) through the keyboard.
3. Write a program to enter the temperature in Fahrenheit and convert it to Celsius. [C = ((F-
32)*5)/9]
4. Write a program to store and interchange two numbers in variables a and b.
5. Write a program to enter two numbers and find the smallest out of them. Use conditional
operator.
6. Write a program to enter text with gets() and display it using printf() statement also find the
length of the text.
7. Write a program to check given year is a Leap year or not.
8. Write a C program to find the maximum from given three numbers (Using Nested IF).
9. Take marks from the user and print grade accordingly ( >=75 marks – Distinction, <75 and
>=60 marks – First, <60 and >=50 – Second, <50 and >=35 – Pass, <35 – Fail) using if … else
if….else statement and also by using logical operators).
10. Write a program to accept number of seconds and display its corresponding hours, minutes
and seconds.
11. Write a program to check whether the blood donor is eligible or not for donating blood. The
conditions laid down are as under. Use if statement.
a) Age should be above 18 yrs but not more than 55 yrs.
12. Write a program to calculate bill of a job work done as follows. Use if else statement.a) Rate of
typing 3 Rs/pageb) Printing of 1st copy 5Rs/pages & later every copy 3Rs/page. The user
should enter the number of pages and print out copies he/she wants.
Unit-2: Control Structure, Array, String & User Defined Functions: (30 Hours)
1. Write a program to find sum of N numbers. (Using while loop)
2. Write a program to print 1,2,3,….N where N number scanned by user. (Using while loop)
3. Write a program to find factorial of given number.
4. Write a program to find reverse of a given number.
5. Write a program to find the sum of first 100 odd nos. and even nos.
6. Write a program to find maximum from given N inputs by user.
7. Write a program to find sum of the digits entered by the user.
8. Write a program to generate Fibonacci series up to N numbers.
9. Write a program to find GCD and LCM of given 2 numbers.
10. Write a program to check whether given number by the user is Palindrome or not.
11. Write a program to check whether the given number is Prime or not.
12. Write a C program to find x1+x2+x3+x4+ …. + xn.
13. Write a program to print following pyramid.
*
**
***
****
14. Write a program that accepts an integer N, if the integer N = 4, then print the pyramid:
1
121
12321
1234321
15. Write a program which will take 10 numbers from user and stored it in the array. It will print all
the numbers, their sum and average of it.
16. Write a program to find binary of given number.
17. Write a program to sort and array.
18. Write a program to search an element from the array.
19. Write a program to find addition of two matrices of 3*3.
20. Take two strings from the user and check whether the string is palindrome or not.
21. Write a program to find sum, average of two numbers passed to user defined functions called
sum(int,int) and average(int,int).
22. Write a program to print Fibonacci series using recursive UDF.
23. Write a program to find length of the given string (without including string.h).
24. Write a program which will accept two strings from the user and print the message that the
strings are same or not.
25. Write a program that uses function digit(N,k) that return the value of the kth digit from the right
of the number N. For eg. The function call digit (254693,2) should return 9.
Unit-3: Structures, Unions, Pointer (30 Hours)
1. Write a program to define structure with tag state with fields’ state name, number of districts
and total population. Read and display the data.
2. Write a program to create a list of books details. The details of a book include title, author,
publisher, publishing year, number of pages, and price.
3. Define a structure called Item with members: Item_code , Item_name, Price. Create an array
of five Items. Create a function which accepts the Item array and modifies each element with
an increase of 10% in the price.
4. Create a program that compare two given dates. To store a date, use a structure that contains
three members namely day, month and year. If dates are equal then display a message as
same otherwise not same.
5. Define a structure that can describe a hotel. It should have members that include name,
address, grade, room charges, grade and no of rooms. Write a function to print out all hotel
details with room charges less than a given value.
6. Write a program to accept records of different states using array of structures. The structure
should contain char state and number of int engineering colleges, int medical colleges, int
management colleges and int universities. Calculate total colleges and display the state, which
is having highest number
a. of colleges.
7. Write a program to accept records of different states using array of structures. The structure
should contain char state, int population, int literacy rate and int suitable data. Display the state
whose literacy rate is highest and whose per capita income is highest.
8. Define a structure employee with members employee name, basic pay, dearness allowance,
house rent, net salary. Declare an array of 5 employees. Write a function which calculates the
net salary of employees and prints all employee details in descending order of their net salary.
9. Define a structure with tag population with fields Men and Women. Create structure with in
structure using state and population structure. Read and display the data.
10. Write a program to create, initialize, assign and access a pointer variable.
11. Write a program in C to demonstrate the use of & (address of) and * (value at address)
operator
12. Program to demonstrate example of double pointer (pointer to pointer).
13. Program to demonstrate example of NULL pointer.
14. Write a program to calculate the square and cube of an entered number using pointer of a
variable containing the entered number.
15. Write a program to Swap Numbers in Cyclic Order Using Call by Reference.
16. Write a program to create an array that will store integer pointers. (Array of pointers)
17. Write a program to demonstrate an example of pointer to an array.
Unit-4: Dynamic Memory Allocation, Link List & Files (30 Hours)
1. Write a program to create a Singly Linked List with following functionalities:
2. Write a program to insert an element at the end of the list.
3. Write a program to insert an element at the beginning of the list.
4. Write a program to delete an element from the list.
5. Write a program to display all the elements of the list.
6. Write a program to insert an element before key value.
7. Write a program to insert an element after key value.
8. Write a program to sort a list.
9. Write a program to display contents of file on the screen. The program should ask for file name.
Display the contents in capital case. Also find the size of the file.
10. Write a program to combine contents of two files in a third File. Add line number at the
beginning of each line.
11. Write a program to display number 1 to 100. Redirect the Output of the program to text file.
12. Write a program to count numbers of lines, words and characters in a file and write contents of
that file in reverse into another file.
13. Write a program to create a file called dictionary.dat that contains the information such as
Name, Surname, City and Phone number. Write a program to accept a city from user and list
details of persons having the given city.
14. Write a program to copy one file to another. While doing so, all extra spaces in a file should be
squeezed to one. For e.g. If a file contains line “I am learning converted to “I am learning C”.
15. Write a program that counts the frequency of a word from a text file. The program should
accept file name as command-line argument. Program should continue to ask word and display
its frequency in a file till the Enter key is pressed without entering any word
16. Write a Program to insert the following contents in a file named “File1”.
Customer No. Account Type Balance
101 Savings 2000
102 Current 5000
103 Savings 3000
104 Current 10000
Append the contents of “File1” in another file “File2”. Also display the contents of File2 on
screen.
Essential / Recommended Readings:
• Programming in ANSI C. (6th Ed.) – Balagurusami - Tata McGraw Hill
Publication
• Programming In C (2nd Ed.) - Ashok N. Kamthane - Pearson Education
Suggestive Readings:
• The C Programming Language - DENNIS M. RITCHIE- AT&T Bell
LaboratoriesMurray Hill, New Jersey
• Let us C – (15th Ed.) - Yashwant Kanetkar - BPB Publications
• Programming in C - Reema Thareja - Oxford University Press