N Nexsus

Programming in C — Major (End Semester) 2025 question paper

MMMUT Foundation (All Departments) previous year question paper for Programming in C (BIT-103), semester 1, Major (End Semester) 2025. All 24 questions are listed below, each with a written answer on Nexsus.

Paper details

  • Subject: Programming in C (BIT-103)
  • Branch: Foundation (All Departments)
  • Semester: 1
  • Exam: Major (End Semester) 2025
  • Questions: 24

Questions asked in Programming in C Major (End Semester) 2025

  1. Q1. Answer any 5 parts of the following.
  2. Q1A. Write a program that takes an integer keyed in from the terminal and extracts and displays each digit of the integer in English. [2 marks]
  3. Q1b. Write a C program to find the greatest common divisors of two numbers. [2 marks]
  4. Q1c. Differentiate between while () and do-while () looping statements with suitable examples. [2 marks]
  5. Q1d. Write down the difference between the associativity and precedence of operators. State the precedence and associativity between relational (<, <=, >, >=) & bitwise (&, ^ , | ) operators. [2 marks]
  6. Q1e. Write an algorithm to check whether input number is Niven number or not. A Niven number, also known as a Harshad number, is an integer that is divisible by the sum of its digits. [2 marks]
  7. Q1f. Differentiate between (state clear purpose): 1.Cache & RAM 2.Compiler & linker [2 marks]
  8. Q1g. Discuss the use of following bit-wise operators with c code: 1. ~ 2. >>2 [2 marks]
  9. Q2. Answer any 2 parts of the following.
  10. Q2a. How do the following two code segments differ in creation of an array ______________________________________ | #define n 5 | scanf("%d", &n); | | int arr[n]; | int arr[n]; | |________________|____________________| Write a C program to multiply two matrices entered by the user. [5 marks]
  11. Q2b. Given an array of integers arr[], write c code to move all the zeros to the end of the array while maintaining the relative order of all non-zero elements. Input: arr[] = [1, 2, 0, 4, 3, 0, 5, 0] Output: arr[] = [1, 2, 4, 3, 5, 0, 0, 0] Explanation: There are three 0s that are moved to the e [5 marks]
  12. Q2c. Explain any four string manipulation library functions with their syntaxes. Write a C program to check whether a string is palindrome or not. [5 marks]
  13. Q3. Answer any 2 parts of the following.
  14. Q3a. What is recursion? Write a recursive function which is used to generate Fibonacci series of $n$ terms. [5 marks]
  15. Q3b. What is function? Differentiate between call by value and call by reference using suitable examples. [5 marks]
  16. Q3c. Write a function def(n) that checks whether $n$ is a deficient number or not. The function should return 1 (one) if the number is deficient, otherwise should return 0 (zero). A deficient number is a positive integer where the sum of its proper divisors (divisors excluding the number itself) is less than the number itself. [5 marks]
  17. Q4. Attempt any Two parts of the following.
  18. Q4a. How does struct differ from unionSec Create a structure called Student with members name, age, and total marks. Write a C program to input data for $n$ students, display their information, and find the average of total marks [5 marks]
  19. Q4b. i. Differentiate between text and binary file creations. What is the significance of r, w, a as file opening modes in fopen() function? ii. What are command line arguments? Write a C program to demonstrate the usage of variables argc and argv passed to main function as function parameters [5 marks]
  20. Q4c. Write a C program utype that takes file name as input on command prompt and displays its contents. For example: $ utype fname1 will display contents of file named fname1. [5 marks]
  21. Q5. Attempt any Two parts of the following.
  22. Q5a. Create a list of $n$ integers dynamically using malloc or calloc functions and sort the integers in ascending order. [5 marks]
  23. Q5b. Explain the memory management done by operating system for running a C program with an appropriate example. [5 marks]
  24. Q5c. What is linked list? Differentiate between single linked list and double linked list. Explain with appropriate examples. [5 marks]