Programming in C — Major (End Semester) 2026 question paper
MMMUT Mechanical Engineering previous year question paper for Programming in C (BIT-156), semester 2, Major (End Semester) 2026. All 24 questions are listed below, each with a written answer on Nexsus.
Paper details
Subject: Programming in C (BIT-156)
Branch: Mechanical Engineering
Semester: 2
Exam: Major (End Semester) 2026
Questions: 24
Questions asked in Programming in C Major (End Semester) 2026
Q1. Attempt any 5 parts of the following.
Q1(a). Define algorithm and flowchart. Write a small C code to print sum of two numbers and explain its steps. [2 marks]
Q1(b). Explain data types and tokens in C. Identify tokens in the following statement: int sum = a + b * 5; [2 marks]
Q1(c). Write a C program to check whether a given number is even or odd. Also explain the logic used. [2 marks]
Q1(d). What is an operator? Write a program to perform basic arithmetic operations (+, -, *, /). [2 marks]
Q1(e). Write a program using if-else ladder to find the grade of a student. Also explain its limitation. [2 marks]
Q1(f). Write a program using loops(for/while) to print a number pattern. Explain entry-controlled vs exit-controlled loops. [2 marks]
Q1(g). Explain switch statement with a program. Why are float values not allowed in switch? [2 marks]
Q2. Attempt any 2 parts of the following.
Q2(a). What is an array? Write a program to input 5 elements and find their sum. Explain array traversal. [5 marks]
Q2(b). What is a 2D array? Write a program to add two matrices (2×2). Explain how elements are stored. [5 marks]
Q2(c). What is a string? Write a program to count vowels in a string. Explain role of '\0'. [5 marks]
Q3. Attempt any 2 parts of the following.
Q3(a). What is a function? Write a program to find sum of two numbers using a function. Explain function call. [5 marks]
Q3(b). What is a pointer? Write a program to display value using pointer. Explain * and & operators. [5 marks]
Q3(c). Write a program to swap two numbers using function. Explain call by value. [5 marks]
Q4. Attempt any 2 parts of the following.
Q4(a). What is a structure? Write a program to store and display details of a student. [5 marks]
Q4(b). What is file handling? Write a program to write data into a file and display it. [5 marks]
Q4(c). What is an array of structures? Write a program to store details of 3 students. [5 marks]
Q5. Attempt any 2 parts of the following.
Q5(a). What is an array? Write a program to find largest element in an array. [5 marks]
Q5(b). What is a string? Write a program to reverse a string. [5 marks]
Q5(c). What is a function? Write a program to find factorial of a number using function. [5 marks]