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

Assignment - 2

The document outlines an assignment for students with tasks related to C programming, divided into three units. It includes writing programs for string manipulation, dynamic memory allocation, and file handling, as well as explaining concepts like arrays, pointers, and structures. Each unit contains specific questions and programming tasks aimed at enhancing understanding of C programming fundamentals.

Uploaded by

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

Assignment - 2

The document outlines an assignment for students with tasks related to C programming, divided into three units. It includes writing programs for string manipulation, dynamic memory allocation, and file handling, as well as explaining concepts like arrays, pointers, and structures. Each unit contains specific questions and programming tasks aimed at enhancing understanding of C programming fundamentals.

Uploaded by

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

Assignment – II

Roll No. – 59 to 88

Unit-III

1. Write a C-Program to check whether the given string is palindrome or not.


2. Define an array. Explain single dimensional array with example.
3. Describe following string handling functions with an example.
(i) strcmp() (ii) strcpy() (iii) strlen() (iv) strrev()
4. Write a program for transpose of a matrix.
5. Specify with an example how a string can be declared, initialized and accessed? What
is difference between using of scanf() and gets() to read a string.
6. Find out the length of a string without using strlen?

Unit-IV

1. Elaborate the importance of dynamic memory allocation in C with examples.


2. Write a C program to read and display multiple strings using pointers.
3. Explain pointer arithmetic.
4. Explain about pointers to pointer with a suitable example.
5. Define Pointer. What are the ways to declare and initialize pointer variables?
6. What is mean by command –line arguments? Write a program that copies the content of
one file into another.

Unit-V

1. Classify different types of files? How to use them?


2. Write a program to open a file and read the file and print the file contents.
3. Explain how to declare, initialize and access the structure elements.
4. Define a structure? Explain nested structures with an example?
5. Write a program to create a structure for an Employee and Find out the average salary
of all employees.

Roll No. – 89 to 116

Unit-III

1. How arrays declared, initialized and accessed give an example.


2. Write a C program to read n elements in to an array and print sum and average of even
numbers present in the array.
3. Define String? Describe various string manipulation functions.
4. Write a program to test whether given string is palindrome or not.
5. Specify with an example how a string can be declared, initialized and accessed? What
is difference between using of printf() and puts() to write a string.
6. List out library functions of Strings. Write a program to find out the vowels in the given
string?
Unit-IV

1. Write a C program to read the elements in an array and print the same in reverse order.
2. Explain Command-Line Arguments with suitable example.
3. Define a pointer? Describe pointer to an array with example.
4. Define a pointer. Write a C-Program to add n numbers using pointers.
5. How can you implement arrays using pointers? Explain it with an example.
6. What is meant by Dynamic Memory Allocation? Explain uses of it with an example.

Unit-V

1. Differentiate unions, structures and arrays?


2. Write a C program that defines a structure employee containing the details such as emp no, emp
name, department name and salary. The structure has to store 20 employees in an organization.
Use the appropriate method to define the above details and define a function that will display the
contents?
3. Explain different modes of file.
4. Write a program to copy the content of one file to another file.
5. Explain structure within a structure with an example.

You might also like