BCA 2nd Sem C Programming
BCA 2nd Sem C Programming
com/imagineitnepal
Tribhuvan University
Faculty of Humanities and Social Science
Bachelor’s in computer applications
3. Define operator. Explain any four types of operators available in C? [1+4] [2020]
4. Explain bitwise and conditional operators with examples. [2+3] [2021]
Unit 5: Input and Output
Unit 6: Control Structure
1. Differentiate between a while loop and do while loop. Write a C program to find input
number is prime or composite [2+3] [2018]
2. Is the break keyword mandatory in the switch statement? Write a program to calculate the
basic arithmetic operation (+, -, *, /) using a switch case statement. [2+8] [2019]
3. Write a program to print the following pattern using a loop. [5] [2021]
U
UN
UNI
UNIV
UNIVE
UNIVER
UNIVERS
UNIVERSI
UNIVERSIT
UNIVERSITY
Unit 7: Array
1. What is a one-dimensional array? How it is initialized? Write a C program to find the
sum of two matrix of order m x n. [1+1+8] [2018]
2. Why is an array required in programming? Write a C programming to input the age of 30
employees into an array and find out the second largest age from the array. [1+4] [2019]
3. Define an array. Write a program to generate the following output using a loop. [1+4]
[2020]
1
12
123
1234
12345
@Imagine IT Nepal → https://www.youtube.com/imagineitnepal
4. Define Array. Write a program to search for an element from an array of 10 numbers.
[1+4] [2021]
Unit 8: User Define Function
1. What is a function? List its advantages. Explain the concept of function call by value and
call by reference with example. [1+2+7] [2018]
2. What is recursive function? Write a C programming to generate the Fibonacci Series up
to the 13th term using a recursive function. [1+4] [2019]
3. Differentiate between iteration and recursion. [5] [2020]
4. Why is a function required in C programming? Write a program to find the smallest
number from the array using a function. [1+4] [2020]
5. Define function. Write a program that find xy using function. [1+4] [2021]
6. Write a program in C to find all possible roots of the quadratic equation ax2 + bx + c = 0
[5] [2019]
Unit 9: Pointer
1. What is DMA? Write a program to find the largest and smallest number in a list of n
numbers using DMA. [1+4] [2018]
2. What is the advantage of pointer? Write a C program to store 10 integers into memory
and find out the minimum and maximum using dynamic memory allocation (DMA).
[1+4] [2019]
3. Why is DMA used in C language? Write a program to enter age of 20 students and count
age between 18 and 25 from the array using DMA function. [1+4] [2020]
4. Define pointer. Write a program to find sum of 10 numbers using pointer. [1+4] [2021]
Unit 10: Structure
1. Define structure and union. Write a C program using structure that reads the record of 35
students with member’s roll, name, address and makes and display the records of students
who have obtained greater than 250 marks. [2+8] [2018]
2. What is structure? Write a C program to enter id, name and address of 25 employees into
structure variable called employee and store them in ascending order on the basis of their
name with use of pointer. [2+8] [2019]
@Imagine IT Nepal → https://www.youtube.com/imagineitnepal
3. What is union? Write a C program to enter bid, title, price, pages of 100 book into a
structure variable called book and sort them in descending order on the basis of their title
with use of pointer. [1+9] [2020]
4. Differentiate between structure and Union. Locate a structure named student with
members roll no, name, address. Write a program that displays name of only those
students whose addressing is Kathmandu. [3+7] [2021]
Unit 11: Data File Handling
1. What is the difference between binary file and text file? Write a C program to write some
text ‘Welcome to BCA program’ in a file test.txt. [2+3] [2018]
2. What is the use of data file in C? Write a C program to accept 100 numbers from user and
store them in odd.txt file (if the number is odd) or even.txt file (if the number is even)
them display odd numbers reading from odd.dat file. [2+8] [2020]
3. Define file opening modes. Write a program to delete specific record form a file. [4+6]
[2021]
Unit 12: Introduction to Graphics
1. Explain any four graphics function in C. Write a program to draw two concentric circles
with center (50, 50) and radii 75 and 125. [2+3] [2018]
2. What is the use of initgraph() in C program? Write a program to draw line and circle and
rectangle using graphic function. [1+4] [2019]
3. Write a C program to generate the following output using graphics functions. [5] [2020]
BCA Program