0% found this document useful (0 votes)
15 views

5-M-ProgrammingusingC_20171130154108.362_X

Uploaded by

romeo24589
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

5-M-ProgrammingusingC_20171130154108.362_X

Uploaded by

romeo24589
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Roll No: ---------------------------

UNIVERSITY OF PETROLEUM AND ENERGY STUDIES

End Semester Examination, December 2017


Program: BCA Semester – I
Subject (Course): Programming using C Max. Marks : 100
Course Code:CSBC1002 Duration: 3 Hrs
No. of page/s: 02

Note: 1. Attempt all the questions.


2. For every programming question, write the algorithm and code.

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?

Q.3 What is recursion? Explain with example.

Q.4 What is pointer to a pointer? Explain with example.

Section B
Each question carries 10 marks

Q.5 What is storage class? Explain any two with example.

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

Q.9 Explain the following with example:

(a) strcpy( )
(b) strlen( )
(c) strcat( )
(d) strupr( )

Q.10 Create a structure to specify data on students given below:

Roll number, Name, Department, Course, Year of joining

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:

Account number, Name, Balance in account.

Assume maximum of 200 customers in the bank.

(a) Write a function to print the Account number and name of each customer with balance
below Rs. 100.

(b) If a customer request for withdrawal or deposit, it is given in the form:

Acct. no, amount, code (1 for deposit, 0 for withdrawal)

Write a program to give a message, “The balance is insufficient for the specified
withdrawal”.
Roll No: ---------------------------

UNIVERSITY OF PETROLEUM AND ENERGY STUDIES

End Semester Examination, December 2017


Program: BCA Semester – I
Subject (Course): Programming using C Max. Marks : 100
Course Code:CSBC1002 Duration: 3 Hrs
No. of page/s:02

Note: 1. Attempt all the questions.


2. For every programming question, write the algorithm and code.

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.

Q.4 Write a program to display the following pattern :

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.7 Discuss any two rules of pointer operations. Give examples.

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

Q.9 Explain the following briefly:

a) Two Dimensional Array

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:

1. Add book information


2. Display book information
3. List all books of given author
4. List the title of specified book
5. List the count of books in the library
6. List the books in the order of accession number
7. Exit

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.

You might also like