DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
ACADEMIC YEAR 2025-2026(ODD)
ASSIGNMENT -II
Course Code & Name : CS25C01 – COMPUTER PROGRAMMING : C
Class : I YEAR CSE (A)
SNO NAME ASSIGNMENT TOPICS
1. Explain the difference between function declaration, definition,
and function call.
AARA DHILBER . K 2.Write and explain a function to compute the square of a float
AMIRTHA PON number.
ARSHINI S 3. Write a function to swap two integers using call by value and
1 ANNUNITHA RAJ A separately using call by reference. Compare both approaches.
ANURAGAN M 4. Write a recursive function to compute factorial of a number.
Include its base and recursive cases.
ANUSGA M
5. Implement a function that computes the GCD of two numbers
using Euclid's algorithm recursively.
1. Write a recursive function to convert a decimal number to binary
and return as a string.
ARTHI B M 2. Create functions to compute the sum and average of elements in
ARTHY BHAVANA an array using output parameters (pointers).
BALARANJANI M 3. Explain scope and lifetime of variables in functions — local,
2
BALAYOGESH R global, and static local variables.
BESSAKKI SANDHIYA 4. Demonstrate modular programming by dividing a program into
B multiple .c and .h files
5. Write functions to calculate area of a circle, rectangle, and
triangle, then call them in a menu-driven program.
3 BHAVANA M 1. Write a function to check if a number is prime and use it to list
BHAVATHALANI P all prime numbers within a given range.
BHUVANASUNDHARI 2. Define a recursive function to print Fibonacci series up to N
N terms.
3. Write a function to determine if a string is a palindrome using
CELSIYA BAANU
recursion.
1
4. Create a function to find the maximum and minimum in an
integer array and return them via pointers.
DEVADARSHINI K R
5. Implement a function to reverse a number using recursion.
1. Provide a function that converts a decimal number to hexadecimal
string using pointers.
DHARSHAN N
2. Write and explain a recursive implementation of the Tower of Hanoi
DHARSHIKA N S problem for 4 disks
DHARSNI K 3. Write a function to calculate nCr (binomial coefficient) using functions
4
for factorial.
DHARUN ABISHEIK S 4. Define a function that returns the rightmost occurrence index of a
DINESH KARTHICK S character in a string
5. Define a function that returns the rightmost occurrence index of a
character in a string
1. Write a function that implements recursive string copy (strcpyRec).
2. Implement a function expand(s1, s2) that expands shorthand
DINESHPANDI N
notations like a-d into abcd.
DIVYA S
3. Write a recursive function that computes the sum of digits of a
5 GOKUL PANDI number.
HARI PRASATH 4. Implement a function to determine if a given 4-digit number is 'well
ordered' (digits increasing).
HARI SRI S
5. Compose a function is_fib_prime(int n) that checks if the nth
Fibonacci number is prime by calling two helper functions.
1. Write a function that checks whether the nth Fibonacci number
is prime.
HARINI P.A. 2. Write a program to compute the length of a string using pointers
HARINI R (without using strlen).
HARINI.M 3. Implement string copy using pointer arithmetic only (*dest++ =
6 *src++) without array indexing.
HARIPRIYA P
4. Concatenate two strings via pointers (like strcat) using pointer
HARISH A arithmetic
5. Reverse a string in place using two pointers (start, end) and
swap operations.
1. Count occurrences of a given character in a string using pointer
HARSHINI traversal.
2. Check if a string is a palindrome using pointers from both ends.
HARSHINI V
3. Compare two strings using pointers (like strcmp, but manual).
7 HARSHITHA V
4. Using pointer arithmetic, determine the length of a string:
HEMAVARNA S return p - str - 1;.
ILAKIYA 5. Traverse a 1-D integer array using pointers to compute the sum
of elements.
8 JANANI ASOKAN 1. Find the maximum element in an integer array via pointer
2
operations.
2. Reverse an integer array using pointers (swap via *start,
JANANI M *end).
JANANI V 3. Multiply two matrices with 2D arrays passed as pointers, using
JASMINE CINDLA B pointer arithmetic.
4. Demonstrate pointer and array behavior difference—explain
JEEVAN KISHORE T
why modifying char *s vs char p[] differs.
5. Explain the purpose of the null character '\0' in strings.
1. Write a dynamic version: read a string length at runtime,
allocate memory via malloc, read string, and free memory.
JEYA SRI R
2. Implement strcpy and strcat using dynamic memory
JEYSIVAHARIS G
(malloc) for destination buffers.
KAMALESH M
3. Create a function that takes a string pointer and returns the index
9
KARTHIKA M of the first vowel (or -1 if none).
KARTHIKAA K S 4. Use pointers to implement a function that removes spaces from
a string in-place.
5. Using pointers, convert uppercase letters in a string to lowercase
(manual ASCII handling).
1. Remove duplicate characters from a string using pointer
traversal and a seen[256] array.
KEVIN CYRUS
RAJSINGH 2. Given pointer p to string "GATE2011", explain what
printf("%s", p + p[3] - p[1]); prints and why.
KINGSLY AZHARIYA
KISHORRE CHARAN N 3. Using pointer arithmetic, evaluate: *(p + p[3] - p[1]) on
10
"GEEK2018" and explain the result.
KOUSALYA LAKSHMI
K 4. Demonstrate pointer-based dynamic memory allocation for a 2D
array (matrix) and access elements via pointers.
5. Write a function that returns a dynamically allocated copy of a
string (strdup equivalent).
1. Explain scope and lifetime of pointers—and risks like dangling
pointers.
LAKSHMI
NARAYANAN S A 2. Implement a function that returns whether two strings are
anagrams, using pointer arithmetic and frequency counting.
LATHIKA M
3. Count the number of subarrays with even sum using pointers to
LOGEETHA.K
11 traverse 1-D arrays.
MANISHA. S 4. Apply pointers to implement dynamic memory handling in
MUKESH KANNAN M functions: e.g., return dynamically created string from a function.
5. Show pointer-to-function usage: write a generic string traversal
function that accepts another function pointer (e.g., void (*func)
(char *)) and applies it to each token.
MUKISHA M 1.Count vowels in a string using only pointer arithmetic and
12 tolower().
3
2.Write a program that dynamically allocates memory for an array
of 5 integers, inputs values, and print them.
DHANUSH A 3.Write a program to reverse a string using pointers.
HARISH T
4.Write a program to demonstrate the use of strlen, strcpy,
ILAKYA TG
and strcmp.
5.Create a function displayInfo() that prints your name, age,
and department. It should have no parameters and return nothing