LOYOLA COLLEGE (AUTONOMOUS), CHENNAI – 600 034
B.Sc. DEGREE EXAMINATION – STATISTICS
|
FIFTH SEMESTER – April 2009
ST 5401 – C AND C ++
Date & Time: 30/04/2009 / 1:00 – 4:00 Dept. No. Max. : 100 Marks
SECTION A
Answer all questions. (10 x 2 = 20)
- Mention any four special operators available in C language.
- What is the use of getchar function?
- If y = 18, what is the value of y << 1?
- What is meant by nested loop? Give an example.
- Write a C program to find the area of a circle with radius ‘r’.
- Mention any four keywords available in C++ but not available in C.
- What is meant by polymorphism?
- Give the syntax of cin and cout statements.
- Write a C++ program to find the greatest among 2 integers.
- If int a[] = {12,3,0,1,2}, what is the value of a[1] – a[0] + a[3]?
SECTION B
Answer any FIVE questions. (5 x 8 = 40)
- Explain the various input and output functions available in C language.
- Write a C program to display all the prime numbers between 1 and 100.
- Explain any two types of ‘if’ statements available in C and give an example for each.
- Write a C program to accept ‘n’ integers and display them in ascending order.
- What is meant by object oriented programming? Explain its advantages.
- Write a C++ program that makes use of the concept of friend function.
- Write short note on recursive functions and give an example.
- Write a C++ program to accept ‘n’ integers and display their mean and variance.
SECTION C
Answer any TWO questions. (2 x 20 = 40)
- a.) Explain the syntax of do – while statement and give an example.
b.) Write a C program to accept a matrix of order m x n and display
its transpose. (10+10)
- a.) Write a C program to accept an alphabet and display whether it is a vowel
or a consonant.
b.) Create a structure by name ‘employee’ that contains the following data members: employee id, basic salary for 10 employees. Write a program to accept the employee id and basic salary for the10 employees by making use of the above structure and display their total income which is the sum of basic salary, DA and HRA where DA is 60% of basic salary and HRA is 20% of basic salary. (8+12)
- a.) Explain the different access specifiers available in C++ with examples.
b.) Write a C++ program to overload the operator ‘+’. (10+10)
- a.) Write short notes on structures and arrays.
b.) Write a C++ program that makes use of the concept of simple inheritance. (10+10)
Latest Govt Job & Exam Updates: