Course Plan (COMP 103)
Course Plan (COMP 103)
Course Objectives:
This course is an introductory course to structured procedural programming concepts. In this course
you will learn how to program basically using C programming Language. Topics include Fundamentals
to Programming, Data Type, Looping Array, Pointers, and Structures etc.
Prerequisite:
Grading Policy:
Final Exam: 50 %
Quiz: 5%
Internals: Assignments: 5%
Lab Report: 5%
Viva Voice 5%
Problem Analysis
SDLC(Software Development Life Cycle)
Algorithm Development & Flowcharting
Coding
Compilation & Execution
Debugging & Testing
Introduction to C [ 2 hrs ]
Historical Development of C
Importance of C
Basic Structure of C Programs
Executing a C Program
Fundamentals of C [4 hours]
Introduction
Arithmetic Operators
Unary Operators
Relational and Logical Operators
Assignment Operators
Conditional Operators
Operator Precedence
Introduction
The if-else Construct
The nested if-else Construct
The else-if ladder Construct
The switch Construct
Loop Control Statements [5 hours]
Introduction
The while Construct
The do-while Construct
The for Construct
Functions [6 hours]
Storage Classes
Automatic, External and Static Variables
Arrays [5 hours]
Introduction
Processing an Array
Passing Arrays to Functions
Multidimensional Array
Structures [5 hours]
Pointers [3 hours]
Introduction
Passing Pointers to Functions
Pointers and One Dimensional Array
Pointers to Structures
Dynamic Memory Allocation
Operations on Pointers
Plagiarism, cheating, and other forms of academic dishonesty will not be tolerated, this may
affect the grading.
…………………………………………………………………………………………………………………………………………..
1. A Sample C program.
2. Some Programming related formatted strings.
1. Write a program that reads a number and identifies whether the given number is even or
odd.
2. Write a program to find the largest number among two numbers
3. Write a program to read the mark of a subject and prints the equivalent grade.
1. Write a program to read a sentence and counts the total number of character (excluding
space) using while loop.
2. Write a program to generate Fibonacci number using do while loop.
3. Write a program to read number and identifies whether the given number is a prime
number or not.
4. (Try this at HOME) Write a program to identify whether the given number is a perfect
number or not. 28 is a perfect number.
5. (Try this at HOME) Write a program to calculate the factorial of a given number.
Programming Set #5: Function
1. Write a program to identify whether the given number is a perfect number or not using a
function. 28 is a perfect number.
2. Write a program to evaluate GCD of two given integers. Use function that returns GCD.
1. Write a C program to store N numbers in a one dimensional array and calculate its
average with the help of the function.
2. Write a C program to convert a binary number to decimal with the help of the function int
todecimal(int bits[20], int length) where bits is the character array to represent bits of
binary numbers and length is the number of bits in the binary number.
1. Write a program to evaluate transpose of n by n matrix with the help of function void
transpose(int matrix[][20], int n) where matrix is the matrix to be transformed and n is the
dimension of matrix.
2. Write a C program for matrix addition with the help of function add(int a[][20], int b[]
[20], int n, int m) where a and b are matrix to be added and n and m are dimension of a
and b.
3. Write a C program to determine determinant of a square matrix with the help of function
int determinant(int a[][], n) where a is the matrix whose determinant is to be found and n
is dimension of square matrix.
1. Write a program to arrange the numbers (array) in ascending order using bubble sort.
1. Write a program that defines a structure called STUDENT with suitable attributes and
reads the data for 5 students. Your program should display the records in ascending order
according to the name of the students.
2. Consider a plane graph. Write a program that uses function to return a distance between
given point and the origin.
Assignment Set #1
Assignment Set #2
Question 1: Compare the use of the if-else statement with the use of conditional operator.
Question 2: What is the purpose of the default keyword?
Question 3: What is the purpose of do-while statement? How does it differ from the while
statement?
Question 4: What is the purpose of the break statement?
Assignment Set #3
Question 1: We use functions to make our programs modular. State at least three advantages of
making your program modular.
Question 2: What is Recursion? What advantages is there in its use?
Question 3: What three types of errors do function-prototypes help prevent?
Question 4: What is meant by the scope of a variable within a program?
Assignment Set #4