Programming Fundamentals — Major (End Semester) 2024 question paper
MMMUT Information Technology previous year question paper for Programming Fundamentals (BIT-151), semester 2, Major (End Semester) 2024. All 24 questions are listed below, each with a written answer on Nexsus.
Paper details
Subject: Programming Fundamentals (BIT-151)
Branch: Information Technology
Semester: 2
Exam: Major (End Semester) 2024
Questions: 24
Questions asked in Programming Fundamentals Major (End Semester) 2024
Q1(a). a) Write an algorithm to find the minimum of all the elements present in a list. [2 marks]
Q1(b). b) With appropriate examples, difference between - i. break & continue ii. union & structure [2 marks]
Q1(c). c) What would be the output of following program segment? [2 marks]
Q1(d). d) Write a C program using recursion to calculate greatest common divisor of two numbers. [2 marks]
Q1(e). e) Differentiate between function call using call by value and call by reference with examples. [2 marks]
Q1(f). Write a macro to_upper(str) that converts all the characters of string 'str' in upper case. [2 marks]
Q1(g). g) What would be the output of following program segment? [2 marks]
Q2(a). a) Write a C program to print all Perfect numbers between 1 to n using a user-defined function perfect(n). The function returns 1 if number n is perfect otherwise returns 0. A perfect number is a number whose sum is equal to its positive divisor [5 marks]
Q2(b). i. State the reason of including header file(s) in C program. What are the roles of linker and loader in C program execution in context to .exe and .obj files. ii. Show the use of '&', '|' and '^' bitwise operators with a C program. [5 marks]
Q2(c). Write a program to input a number and check and print whether it is a Pronic number or not. [Pronic number is the number which is the product of two consecutive integers.]Examples: 12 = 3 *4 20 = 4 *5 42 = 6 *7 [5 marks]
Q3(a). a) Write a C program to display only those strings of a list of strings which starts with a vowel. [5 marks]
Q3(b). b) Write a program in C to merge two arrays of same size each sorted in ascending order, but the merged array should have elements in descending order. [5 marks]
Q3(c). c) Write a C program to print the lower triangular matrix. [5 marks]
Q4(a). i. Give an example for each of the two types of recursive functions- head recursion and tail recursion. ii. What does exit(1) signify? How it is different from exit(0)? [5 marks]
Q4(b). b) Write a C program to create a single linked list. Write a function display(st) which displays the list and search (item, st) to search item in the list which starts with address stored in st pointer. [5 marks]
Q4(c). c) Write a C program to create and display a double linked list. [5 marks]
Q5(a). a) Write a C program to read contents of a text file and writes them back to a second file after converting the uppercase contents into lowercase and vice-versa. [5 marks]
Q5(b). b) Write a C program to process the result of a class having name, rollno, marks of physics, chemistry and maths for each student with remarks pass or fail. Store each such record in a binary file by using fwrite() function. [5 marks]
Q5(c). c) Discuss the syntax and usage of following: i. fopen() with a+, w+ operation modes ii. fseek() iii. ftell() iv. command line arguments v. malloc() and calloc() [5 marks]