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

Lab Report - 5

The document outlines a series of programming tasks in C, focusing on the use of structures, pointers, and file handling. It includes creating a student structure, performing operations on complex numbers, managing arrays, and file manipulation. Additionally, it includes drawing basic geometric shapes through programming.

Uploaded by

iamanuroadh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Lab Report - 5

The document outlines a series of programming tasks in C, focusing on the use of structures, pointers, and file handling. It includes creating a student structure, performing operations on complex numbers, managing arrays, and file manipulation. Additionally, it includes drawing basic geometric shapes through programming.

Uploaded by

iamanuroadh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

C Programming – Lab Report V

1. Write a menu driven program which performs the following jobs:


a. Create a structure named student with member variables: roll, name, grade, gender,
age.
b. Define ten structure variables of type student and using loop take input for all ten
structure variables.
c. Display names of all male students.
d. Exit.

2. Write a program to add two complex number using structure.

3. Write a program to add two complex number using structure and user defined function.

4. Write a program to multiply two complex number using structure.

5. Write a program to add two distance in feet-inch system using structure and user defined
function.

6. Write a program to find difference between two time periods using structure.

7. Write a program to read records of n students and display details of student having highest
mark.

8. Write a program to read records of n different students in structure and sort on the basis of
marks in ascending order.

9. Write a program to display the address and value of a variable using pointer.

10. Write a program that accesses array elements of a one-dimensional array using pointers.

11. Write a program to add two mxn matrices using pointer.

12. Write a program to pass pointer variable to function, sum them and display after returning
it.

13. Write a program to calculate average marks of 5 students in a subject using pointer.

14. Write a program to read an array of integers using DMA and display the maximum and
minimum value.

15. Write a program where a function accepts a string and a character. The function should look
for the first occurrence of the character in the string and return a pointer to that location.

SULAV NEPAL ([email protected]) 1


16. Write a program to create a file named demo.txt and write some text “I am studying well for
board exam” to the file.

17. Write a program to open the file named demo.txt, read its content and display it to screen.

18. Write a program to append some text to a file by reading filename from user.

19. Write a program to open a file and copy all its content to another file.

20. Write a program where a text file is given and another text file should be created deleting all
the vowels (a, e, i, o, u).

21. Write a program to create a file named student.txt and write name, roll, address, and marks
of a student to this file.

22. Write a program to draw a circle.

23. Write a program to draw a line.

24. Write a program to draw a square.

25. Write a program to draw a right-angled triangle.

SULAV NEPAL ([email protected]) 2

You might also like