FACULTY OF ENGINEERING & INFORMATICS
B.E. I ? Year (Main) (Common to All Branches) Examination s
June 2013
Subject: Programming in C and C++
--- Content provided by FirstRanker.com ---
Time: 3 HoursMax.Marks: 75
Note: Answer all questions from Part A. Answer any five questions from Part B.
PART ? A (25 Marks)
1. Evaluate (00001000 & 11000101) A (11110000).
--- Content provided by FirstRanker.com ---
2. What is the difference between assembly language and machine language?3. What is the value of the expression (0 < j < 1)? Does this expression achieve the
goal of checking that the value of j is between 0 and 1, exclusively? If so, say why? If
not, write an expression that does that.
4. Consider the following function:
--- Content provided by FirstRanker.com ---
void f (unsigned int n){
do {
putchar (`0' + (n % 10));
) while (n / = 10);
--- Content provided by FirstRanker.com ---
putchar (` WV);)
What is the output of f (837)?
5. What is the importance or use of a static variable?
6. How does write mode differ from append mode when an existing file is being written
--- Content provided by FirstRanker.com ---
to?7. What are inline functions?
8. List the operators that can not be overloaded.
9. What is the purpose of abstract base class?
10. Give the three standard I/O stream objects in C++.
--- Content provided by FirstRanker.com ---
PART ? B (50 Marks)11.(a) Explain various steps in the development and execution of a typical C program.
(b) Write a program to reverse a given number.
12.(a) Write a function to search a number in a given list of numbers using linear search.
(b) Explain the usage of pointer variables in accessing elements in a multidimensional
--- Content provided by FirstRanker.com ---
array.13.(a) Write a program that accepts student's roll number and name and stores the details
in a list of student records ordered roll-number-wise.
(b) What is a union? How do you declare and initialize a union in a C program?
.. 2.
--- Content provided by FirstRanker.com ---
FirstRanker.com - FirstRanker's ChoiceCode No. 2006
FACULTY OF ENGINEERING & INFORMATICS
B.E. I ? Year (Main) (Common to All Branches) Examination s
June 2013
--- Content provided by FirstRanker.com ---
Subject: Programming in C and C++Time: 3 Hours
Max.Marks: 75
Note: Answer all questions from Part A. Answer any five questions from Part B.
PART ? A (25 Marks)
--- Content provided by FirstRanker.com ---
1. Evaluate (00001000 & 11000101) A (11110000).2. What is the difference between assembly language and machine language?
3. What is the value of the expression (0 < j < 1)? Does this expression achieve the
goal of checking that the value of j is between 0 and 1, exclusively? If so, say why? If
not, write an expression that does that.
--- Content provided by FirstRanker.com ---
4. Consider the following function:void f (unsigned int n)
{
do {
putchar (`0' + (n % 10));
--- Content provided by FirstRanker.com ---
) while (n / = 10);putchar (` WV);
)
What is the output of f (837)?
5. What is the importance or use of a static variable?
--- Content provided by FirstRanker.com ---
6. How does write mode differ from append mode when an existing file is being writtento?
7. What are inline functions?
8. List the operators that can not be overloaded.
9. What is the purpose of abstract base class?
--- Content provided by FirstRanker.com ---
10. Give the three standard I/O stream objects in C++.PART ? B (50 Marks)
11.(a) Explain various steps in the development and execution of a typical C program.
(b) Write a program to reverse a given number.
12.(a) Write a function to search a number in a given list of numbers using linear search.
--- Content provided by FirstRanker.com ---
(b) Explain the usage of pointer variables in accessing elements in a multidimensionalarray.
13.(a) Write a program that accepts student's roll number and name and stores the details
in a list of student records ordered roll-number-wise.
(b) What is a union? How do you declare and initialize a union in a C program?
--- Content provided by FirstRanker.com ---
.. 2.Code No. 2006
-2-
14.(a) Write a C++ program to create a RATIONAL class and find the sum of two rational
numbers using operator overloading. Extend the program to add in' rational
--- Content provided by FirstRanker.com ---
numbers.(b) How do you specify default arguments in function definition? Illustrate with an
example.
15.(a) Explain how virtual functions are used along with base class pointers to implement
run-time polymorphism.
--- Content provided by FirstRanker.com ---
(b) What is the difference between function overloading and function overriding? Explainwith an example.
16.(a) Write a C++ program using function template to perform addition, multiplication of
two matrices. It should support integer, float, and double data types.
(b) Illustrate scope rules of C language with suitable examples.
--- Content provided by FirstRanker.com ---
17. Write short notes on:(a) Passing of multidimensional arrays as arguments to functions
(b) Conditional compilation
(c) Exception handling.
FirstRanker.com - FirstRanker's Choice
--- Content provided by FirstRanker.com ---