BCSL-021 C Programming Lab | Solved Question Papers


These questions are collected from previous years term end exam papers conducted by IGNOU. The questions are arranged according to topic covered in BCSL-021 subject. Try to solve these questions yourself then read the solutions presented here. Programs are tested on CodeBlock and Turbo C++ compiler.

1. Write a C program to find the smallest among the 3 numbers given as input. [Dec 2015, Set-3] Solution

2. Write a C program to find the sum of n numbers given as input by the user. [June 2015, Set-1] Solution

3. Write a C program to find the factorial for a given number. [Dec 2014, Set-2] Solution

4. Write a program to find the factors of a given number. [Dec 2014, Set-4] Solution

5. Write a C program to find and display the sum of all digits for a given 5-digit number. [June 2015, Set-4]  Solution

6. Write a C program to find the string length of a given string.
Note : Should not use the “strlen( )” function. [Dec 2015, Set-4]  Solution

7. Write a C program to count the number of vowels in a given string and display all the vowels in it. [Dec 2015, Set-1]  Solution

8. Write an interactive program in C to do the following operations on strings by providing the choice using the ‘switch’ statement :
(a) To find the string-length of a given string.
(b) To concatenate 2 strings.
(c) To change all the characters to lower-case for a given string.
(d) Exit. [Dec 2014, Set-2]

9. Write a C program to swap the values of 2 integer variables “a” and “b” and display them.
Note : Use Pointers concept. [Dec 2015, Set-2] Solution

10. Write a C program to sort a list of given 5 numbers in descending order. [June 2014, Set-4]  Solution

11. Write a C program to find the largest and smallest numbers among the given list of 5 numbers. [Dec 2014, Set-4]

12. Write an interactive C program to arrange the given 5 strings in alphabetical order.[Dec 2014, Set-3] Solution

13. Write a C program to add two matrices A(m x m) and B(m x m) and store the sum in C(m x m). [June 2015, Set-3]

14. Write an interactive program to perform the following computations (on Matrices A and B of order 3 x 3) by providing the options using a “Switch” statement :
(i) Add 2 matrices
(ii) Multiply 2 matrices
(iii) Exit[Dec 2015, Set-2]

15. Write a C program to find the total and average of marks for 5 students in English, Hindi, Social Science, Science and Maths. The maximum marks in each subject is 100 and the pass marks in each subject is 40.
Note : Use structures concept. [June 2015, Set-2]

16. Write an interactive C program to calculate the Gross salary and Net salary of 5 employees working in a retail outlet if Basic, DA, TA, Allowances and Deductions are given. Use Structures concept.
Note : Assumptions can be made wherever necessary.[Dec 2014, Set-1]

17. Write a C program to do the store name, eno, programme, programme_code, regional_centre, study centre code and state of 10 students in a file named “stu_record”. [June 2015, Set-3]
Note : Use “files” concept.

18. Write an interactive C program to input 10 students’ record in a data file (.dat) of BCA 2nd semester and take the input as ENo from the user, search and display the whole details of the respective student. [Dec 2015, Set-4]
Note : Use Structures and File Handling concepts.

19. Write a C program to take the inputs Emp_No, Emp_Name, Sex, Age, Department, Designation, Basic_Pay, Address, Mobile_No and Email_Addr for 10 employees and store them in a .dat file (data file). Accept Emp_No from the user, search and display the Emp_No, Emp_Name, Department and Basic_Pay respectively.
Note : Use Structures and File Handling concepts.[Dec 2015, Set-3]

20. Write an interactive C program to generate a bill for the ordered items for a Fast Food Restaurant.
Note : Assumptions can be made wherever necessary.[Dec 2015, Set-1]

21. Write an interactive C program to generate a bill for a stationery shop.
Note : Assumptions can be made wherever necessary.[June 2015, Set-1]