0% found this document useful (0 votes)
82 views

Assignment Day5

The document outlines an assignment involving pointers and structures in C programming. It includes 7 programming tasks: 1) implementing matrix addition using different pointer approaches, 2) checking if a string is a palindrome, 3) reversing a string using a pointer, 4) counting the words in a string using a pointer, 5) deleting a pattern from a string, 6) developing string handling functions similar to string.h, and 7) creating a menu-driven program for employee record management using an array of structures. Proper programming style and debugging is emphasized.

Uploaded by

abhijeetv2
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
82 views

Assignment Day5

The document outlines an assignment involving pointers and structures in C programming. It includes 7 programming tasks: 1) implementing matrix addition using different pointer approaches, 2) checking if a string is a palindrome, 3) reversing a string using a pointer, 4) counting the words in a string using a pointer, 5) deleting a pattern from a string, 6) developing string handling functions similar to string.h, and 7) creating a menu-driven program for employee record management using an array of structures. Proper programming style and debugging is emphasized.

Uploaded by

abhijeetv2
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

ACTS-DESD Course (2014)

Assignment 5
Note:
Use pointers and structures to code the programs.
Use gdb to debug the programs.
Choose meaningful filenames, identifier names.
Write well documented programs using comments.
Use indentation within the programs.

1. Implement matrix addition using
a) Two dimensional array b) Array of pointers
c) Pointer to an array d) Double pointers
2. Write a program to find if the given string is a palindrome or not.
3. Write a program to reverse a string using pointer.
4. Write a program to get the word count in a string using pointer to the string.
5. Write a function del_pattern(char *pattern, char *str) which deletes the pattern pointed to
by pattern from the string pointed to by str.
6. Develop my_strings.h, similar to strings.h which contains the functions:
my_strcmp(char *str1, char *str2): Compares str1 with str2
my_strcpy(char *str1, char *str2): Copies str1 to str2
my_strcat(char *str1, char *str2): Concatenates str1 after str2
my_strlwr(char *str1): Converts str1 to lower case
my_strupr(char *str1): Converts str1 to upper case
Extend the program to include
my_strncmp(char *str1, char *str2, int n): Compare first n characters of str1 and str2
my_strncpy(char *str1, char *str2, int n): Copy first n characters of str1 to str2
my_strncat(char *str1, char *str2, int n): Concatenate first n characters of str1 after str2.
7. Write a menu driven program to implement record management for the employee using
structures. The menu should display following items:
1. Add a record
2. Delete a record
3. Modify a record
4. Display a record
5. Display all records
6. Exit

A record should contain employee no.(unique), emp name, department, age. The
program should run continuously until the user selects exit option in the menu.
Hint: Use array of structure to hold the records.

You might also like