Solution For Practical-Lab-1
1. Write a program to find factorial of a number using loop and recursion.
2. Write a program to find factors of a given number.
3. Write a program to check whether a number is prime or not.
4. Write a program to find GCD using loop and recursion.
5. Write a program to calculate power using loop and recursion.
6. Write a program to display prime numbers between two intervals.
Solution For Practical-Lab-2
1. Read n numbers in an array and print their sum and average.
2. Write a program to find the largest element in an array.
3. Read n numbers in an array then read two different numbers, replace 1st number with 2nd number in an array and print the final array.
4. Write a program to copy all the elements of one array to another array.
5. Read n numbers in an array and print it in ascending order.
6. Write a program to find common elements between two arrays.
7. Write a program to find common elements between two arrays.
Solution For Practical-Lab-3
1. Read two 2x2 matrices and perform addition of matrices into third matrix and print it.
2. Read two matrices, first 3x2 and second 2x3, perform multiplication operation and store result in third matrix and print it.
3. Write a program to find transpose of a square matrix - transpose of matrix means swapping the row and column of the original matrix.
Solution For Practical-Lab-4
1. Read n numbers in an array and print it using pointer.
2. Write a C program to swap two numbers, calling an UDF by value.
3. Write a C program to swap two numbers, calling an UDF by reference.
4. Write a program to nd largest element in the array using Pointer.
5. Write a program to check if the string is a palindrome or not using Pointer.
Solution For Practical-Lab-5
1. Create a structure Employee_Detail (Employee_id, Name, Designation, Salary). Write a program to read the detail from user and print it.
2. Create an array of structure Student_Detail (Enrollment_no, Name, Sem, CPI) for 5 students, scan their information and print it.
3. Create a structure Employee_Detail (Employee_id, Name, Designation, Salary). Write a program to read the detail from user and print it using Structure Pointer.
4. Write a program to add two complex numbers by passing structure to a Function.
Solution For Practical-Lab-6
1. Write a menu driven program to perform following operations on Stack: PUSH, POP, PEEP, CHANGE and DISPLAY.
2. Write a program to reverse a string using Stack.
Solution For Practical-Lab-7
1. Write a program to convert the given infix notation to postfix notation.
2. Write a program to convert the given infix notation to prefix notation.
Solution For Practical-Lab-11
1. Write a program to get n elements of an array from user and print those elements using pointer.
2. Write a program to display n elements and sum of those elements using dynamic memory allocation. Also release the memory occupied after displaying.
Solution For Practical-Lab-12
1. Write algorithms to perform following operations on Singly Linked List:
◦ Insert a node at the beginning of the linked list
◦ Insert a node at the end of the linked list
◦ Delete a node
2. Write a menu driven program to implement following operations on the singly linked list:
◦ Insert a node at the end of the linked list
◦ Delete the first node of the linked list
◦ Delete the last node of the linked list
◦ Display the list
◦ Delete a specific node
◦ Count number of nodes
Solution For Practical-Lab-13
1. Write a menu driven program to implement following operations on the Ordered Linked List.
◦ Insert a node such that linked list is in ascending order
◦ Display the list
◦ Delete a rst node of the linked list
◦ Delete a last node of the linked list
◦ Delete a specific node
Solution For Practical-Lab-14
1. Write a program to implement stack using linked list.
2. Write a program to implement queue using linked list.
Solution For Practical-Lab-15
2. Write a menu driven program to implement following operations on the Circular Linked List.
◦ Insert a node at the beginning of the linked list
◦ Insert a node at the end of the linked list
◦ Display the list
◦ Delete a specific node
Solution For Practical-Lab-18
1. Read n numbers in an array from user and sort them in ascending order using Bubble Sort algorithm and print sorted array.
2. Read n numbers in an array from user and sort them in ascending order using Selection Sort algorithm and print sorted
array.
3. Read n numbers in an array from user and sort them in ascending order using Insertion Sort algorithm and print sorted
array.
4. Read n numbers in an array from user and sort them in ascending order using Quick Sort algorithm and print sorted array.