Dear students,
Here is the list of practicals that should be contained in your FOC lab file. Each experiment must contain source code of the program and output obtained from sample run of the program. Practicals must be in the same order in which they have been given below. Practical file must be submitted on or before 18th of November.
LIST OF PRACTICALS
1. Write a program to perform swapping of values of two variables.
2. Write a program to find whether an year entered by user is leap year or not.
3. Write a program to print division of student using if-else and/or if-else if decision statements.
4. Write a program to find factorial of a number using FOR and WHILE loop.
5. Write a function power(a,b) to calculate the value of a raised to power b.
6. Write a function to compute area and parameter of a triangle. User should enter three sides of the triangle. Area and parameter should be printed in main.
7. Write a function that receives marks received by a student in 3 subjects and returns the average and percentage of these marks. Call this function from main ( ) and print the results in main ( ).
8. Write a program to search a particular element from an array. Also find number of times it appears in the array.
9. Write a program to print array elements along with their address (using/without using) pointer.
10. Write a function to modify values of an array to contain values which are 5 more than current values. Modified values should be printed in main ( ).
11. Write a program to create a two dimensional array and print its elements using pointers.
12. Write a program to find whether a string is palindrome or not. A string is said to be palindrome if we get the same string on reversing it. (For ex. “wow” is palindrome).
13. Write a program to reverse a string. You may use a user defined function REVERSE( ) for this purpose.
14. Write a user defined function XSTRLEN( ) for finding length of string.
15. Write a program to show difference between structure and union. Program should differentiate based on following points:
(a) Size of structure and union variables.
(b) Memory addresses allocated to union and structure variables.
16. Write a program to show use of array of structure. Program should allow user to enter details(name, age and roll) of five students and then print it. Structure variables should be used to enter details and pointer to structure should be used for printing the details.
17. Write a program showing use of enumeration. Program should create a data type named ROLL which will take five values 0,1,2,3,4. Program should assign these values to variables of type ROLL and then print values of the variables. Program should also demonstrate usage of TYPEDEF.
18. Write a program to show use of bit field. Program should print size of structure variable using (without using) bit field.