LOYOLA COLLEGE (AUTONOMOUS), CHENNAI – 600 034
|
B.Sc. DEGREE EXAMINATION – STATISTICS
FIFTH SEMESTER – November 2008
ST 5401 – C AND C ++
Date : 14-11-08 Dept. No. Max. : 100 Marks
Time : 9:00 – 12:00
PART A
Answer ALL questions. (10×2=20)
- Mention the difference between signed and unsigned integer.
- Give the syntax of scanf() function.
- If x = 12 and y = 10, what is the value of x&y?
- What are recursive functions?
- Write a C program to find the sum of squares of the first 10 integers.
- Mention the difference between local and global variable.
- What is meant by data hiding?
- Give the syntax of declaring a structure.
- Write a C++ program to calculate the simple interest.
- What are header files?
PART B
Answer any FIVE questions. (5×8=40)
- Explain the various steps to be followed in writing a C program.
- Write a C program to accept three integers and display the maximum among them.
- Explain the syntax of switch – case statement and give an example.
- Write a C program to accept ‘n’ integers and display their mean and variance.
- What are public, private and protected access specifiers? Give an example for each.
- Write a C++ program that makes use of the concept of polymorphism.
- Write short notes on inline functions and operator overloading.
- Write a C++ program to print the multiplication table form 1 to 12.
PART C
Answer any TWO questions. (2×20=40)
- a.) Explain the different data types available in C.
b.) Write a C program to accept two matrices each of order m x n and display
their sum and difference. (10+10)
- a.) Write a C program to arrange ‘n’ integers in ascending order.
b.) Create a structure by name ‘student’ that contains the following
information: student id_no, marks in test 1 and test 2. Write a C program to
accept the above information for 10 students and display their average marks. (10+10)
- a.) Explain the different components of object oriented programming.
b.) What are friend functions? Give an example for the same. (10+10)
- a.) Write a C++ program to overload the operator ‘++’.
b.) Write a C++ program that makes use of the concept of hierarchical
inheritance. (10+10)
Latest Govt Job & Exam Updates: