5-M-ProgrammingusingC_20171130154108.362_X
5-M-ProgrammingusingC_20171130154108.362_X
Section A
Each question carries 5 marks
Q.1 What are the differences between structures and union? Explain with example.
Q.2 Explain the difference between pass by reference and pass by value with example?
Section B
Each question carries 10 marks
Q.6 Write a program to pick up the largest number from any 5 row by 5 column matrix.
Q.7 Write a program to delete all vowels from a sentence. Assume that the sentence is not more
than 80 characters long.
Q.8 Write a program to enter the numbers till the user wants and at the end it should display the
count of positive, negative and zeros entered.
Section C
Each question carries 20 marks
(a) strcpy( )
(b) strlen( )
(c) strcat( )
(d) strupr( )
Assume that there are not more than 200 students in the college:
(a) Write a function to print names of all students who joined in a particular year.
(b) Write a function to print the data of a student whose roll number is given.
OR
Q.10 Create a structure to specify data of customers in a bank. The data to be stored is:
(a) Write a function to print the Account number and name of each customer with balance
below Rs. 100.
Write a program to give a message, “The balance is insufficient for the specified
withdrawal”.
Roll No: ---------------------------
Section A
Each question carries 5 marks
Q.1 What are Library functions in C? Explain any two with example.
Q.2 “Function can return multiple values”, explain this statement with example.
Q.3 Give the difference between ‘while loop’ and ‘do while loop’ with example.
1 2 3 4
1 2 3
1 2
Section B
Each question carries 10 marks
Q.5 Write a program to enter a string through user and find whether the entered string is
palindrome or not.
Q.6 WAP that using recursive function for the following:
i) To find the factorial of a given integer.
ii) To find the GCD (greatest common divisor) of two given integers.
Q.8 Twenty-five numbers are entered from the keyboard into an array. The number to be
searched is entered through the keyboard by the user. Write a program to find if the number
to be searched is present in the array and if it is present, display the number of times it
appears in the array.
Section C
Each question carries 20 marks
b) Union
Q.10. There is a structure called employee that holds information like employee code, name, date
of joining. Write a program to create an array of the structure and enter some data into
it, then ask the user to enter current date. Display the names of those employees whose
tenure is 3 or more than 3 years according to the given current date.
OR
Q.10 Write a menu driven program that depicts the working of a library. The menu options
should be:
Create a structure called library to hold accession number, title of the book, author name,
price of the book, and flag indicating whether book is issued or not.