Loyola College B.Sc. Statistics April 2006 C And C ++ Question Paper PDF Download

             LOYOLA COLLEGE (AUTONOMOUS), CHENNAI – 600 034

B.Sc. DEGREE EXAMINATION – STATISTICS

FIFTH SEMESTER – APRIL 2006

                                                                   ST 5401 – C AND C ++

(Also equivalent to STA 401)

 

 

Date & Time : 17-04-2006/AFTERNOON   Dept. No.                                                       Max. : 100 Marks

 

 

PART – A

Answer all the questions.                                                                  10 ´ 2 = 20

 

  1. List the characters involved in the character set of C.
  2. How do string constants differ from character constants?
  3. Write a C program to compute the product of two given numbers.
  4. j = 1

while ( j<=4)

{

printf( “%d”, j);

j = j + 1;

}

What is the output of this program?

  1. What is an array?
  2. Define Classes.
  3. Write any two application of C++.
  4. Find errors, if any, in the following C++ statements.

cout<<”x = “ X;

cin>>x;>>y;

  1. Distinguish between private and public section.
  2. What is a function in C++?

 

PART – B

Answer any five questions.                                                                           5 ´ 8 = 40

 

  1. What are increment and decrement operators? Explain their uses with examples.
  2. When the principal, rate of interest and period of deposit are given, write a C program to compute the simple interest and the compound interest.
  3. Write a C program to find the mean of two numbers using function“.
  4. Write a C program to count the number of boys whose weight is less than 50 kgs and height is greater than 170 cm and also print their corresponding weights and heights.
  5. Explain the following conditional statements:

a). if statement            b). nested if  c). while … do and d). do while.

  1. Define overloaded functions to display two and three values.
  2. Write a C++ program to find the largest of given n positive numbers
  3. Write a C++ program to arrange a set of n values in the ascending order

PART – C

Answer any two questions.                                                   2 ´ 20 = 40

 

  1. a). The mean and variance of a set of n values x1,x2,…,xn are given by the formulas

Mean = Sxi / n

Variance = (1/n) Sxi2 – (Sxi /n)2

Write a C program to find the mean and variance.

b). Explain switch statement and give an example.                                (12 + 8)

  1. a). Write a C program for raising a whole number to a power with help of function.(Raising the value i to power j is denoted as i j in Mathematics).

b). Explain two-dimensional array and give an example.                       (13 +7)

 

  1. a). If the annul gross income of a person exceeds Rs.20,000,  he has to pay 25% of his income tax and 7% of his gross-income as profession tax. Otherwise, he has to pay 15% of his gross-income as income tax and 5% of his gross-income as profession tax.  Write a C++ program to read in the gross-income of a person and calculate the income tax and the profession tax to be paid by him.

 

b). A bank provides an interest of 10% on deposits up to Rs.8000, 12% for deposits between Rs.8001 and Rs.12000 and 15% for deposits above Rs.12000.  Write a program to calculate one year’s interest for a given deposit amount according to the above rules.                                                          (10 +10)

  1. a). Write a  C ++ program to find out whether a given number   n   is a prime number .

b). Write a C++ program to perform addition, multiplication and division of two numbers using class concept.                                                    (6+14)

 

Go To Main page

Loyola College B.Sc. Statistics April 2007 C And C ++ Question Paper PDF Download

                LOYOLA COLLEGE (AUTONOMOUS), CHENNAI – 600 034

B.Sc. DEGREE EXAMINATION – STATISTICS

AC 21

 

FIFTH SEMESTER – APRIL 2007

ST 5401 – C AND C ++

 

 

 

Date & Time: 04/05/2007 / 1:00 – 4:00 Dept. No.                                              Max. : 100 Marks

 

 

PART A

Answer all the questions.                                                                        10 X 2 = 20

 

  1. Explain briefly “ scanf” and “printf” with an illustration.
  2. Write a program to output the following multiplication table.

5 X 1 = 5

5 X 2 = 10

……….

……….

5 X 10 = 50

  1. Explain decrement operator with an example.
  2. Write a program to convert the Fahrenheit to Celsius the following conversion formula: C = (F-32)/ 1.8.
  3. Identify syntax errors in the following program. After correcting, what output would you expect when you execute it?

Main ()

{

int r,c;

float perimeter: area,

c=3.1415;

r=5;

perimeter = 2.0 c*r;

area= c*r*r;

printf(“%f”,”%d”,&perimeter, &area)

}

  1. Mention any one salient feature of C++ when compared to C.
  2. What is the output of the following program?

main ()

{

int a = 2, n=100;

while(a<n)

{

cout<<a<<endl;

a=a*a;

}

}

  1. Write a program to find the largest number of the two numbers in C++.
  2. What is function in C++? And give an example for function.

 

 

 

 

 

  1. What is the output, corresponding to the following segment?

a=10;

b=15;

x=(a>b)?a:b;

cout<<x;

 

PART B

Answer any five questions.                                                               5 X 8 = 40

 

  1. Explain different types of constants in c programming.
  2. The traveling time by train from one city to another city is given in terms of minutes (eg. 280 minutes). Write a c program that reads the given value, converts it into hours: minutes format and display the same.
  3. When the principal, rate of interest and period of deposit are given, write a c program to compute the simple interest and compound interest using function.
  4. There are three categories (A, B, C) of employees in a company. They are charged 30%, 20% and 15% respectively of their salaries as income tax. Write a c program to find the income tax to be paid by him.
  5. The commission on a representative’s sales is calculated as follows:

a). if sales<Rs. 500, then there is no commission.

b). if Rs. 500 < sales < Rs. 5000, then commission = 10% of sales.

c). if sales > Rs. 5000, then commission = 5000 + 8% of sales .

Write a C++ program which reads in total sales and calculates commission.

  1. Write a C++ program to calculate perimeter with help of function overloading using the following conditions.

a). when two sides are equal then perimeter = 2(a+(a2 – h2)) units.

b). when three sides are known but not equal perimeter = a + b +c

  1. Write a C++ program to calculate addition of two matrices with the order of 4X4.
  2. Develop a function in C++  and calculate the factorial value of an integer n. Using this in the main () function to compute  ncr.

PART C

Answer any two questions.                                                               2 X 20 = 40

 

  1. a). Explain switch statement in C and give an example with the same.(5+5)

b). Write a C program to calculate mean and variance for N values with help of

array.                                                                                                         (10)

  1. a). Explain nested if statement with suitable example.                                   (5+5)
  2. b). Explain one and two-dimensional arrays with examples.                          (5+5)

 

  1. a). Explain function overloading.                                                                   (5)

b). Write a C++ program with help of function overloading to find out the largest number among two and three numbers.                                                             (15)

Go To Main page

 

 

 

 

 

Loyola College B.Sc. Statistics Nov 2008 C And C ++ Question Paper PDF Download

LOYOLA COLLEGE (AUTONOMOUS), CHENNAI – 600 034

BA 15

 

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)

 

  1. Mention the difference between signed and unsigned integer.
  2. Give the syntax of scanf() function.
  3. If x = 12 and y = 10, what is the value of x&y?
  4. What are recursive functions?
  5. Write a C program to find the sum of squares of the first 10 integers.
  6. Mention the difference between local and global variable.
  7. What is meant by data hiding?
  8. Give the syntax of declaring a structure.
  9. Write a C++ program to calculate the simple interest.
  10. What are header files?

PART B

 

      Answer any FIVE questions.                                                                                               (5×8=40)

 

  1. Explain the various steps to be followed in writing a C program.
  2. Write a C program to accept three integers and display the maximum among them.
  3. Explain the syntax of switch – case statement and give an example.
  4. Write a C program to accept ‘n’ integers and display their mean and variance.
  5. What are public, private and protected access specifiers? Give an example for each.
  6. Write a C++ program that makes use of the concept of polymorphism.
  7. Write short notes on inline functions and operator overloading.
  8. Write a C++ program to print the multiplication table form 1 to 12.

 

PART C

      Answer any TWO questions.                                                                                              (2×20=40)

 

  1. 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)

 

  1. 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)

 

  1. a.) Explain the different components of object oriented programming.

b.) What are friend functions? Give an example for the same.                                        (10+10)

 

  1. 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)

 

 

Go To Main Page

Loyola College B.Sc. Statistics April 2009 C And C ++ Question Paper PDF Download

  LOYOLA COLLEGE (AUTONOMOUS), CHENNAI – 600 034

B.Sc. DEGREE EXAMINATION – STATISTICS

YB 21

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)

 

  1. Mention any four special operators available in C language.
  2. What is the use of getchar function?
  3. If y = 18, what is the value of y << 1?
  4. What is meant by nested loop? Give an example.
  5. Write a C program to find the area of a circle with radius ‘r’.
  6. Mention any four keywords available in C++ but not available in C.
  7. What is meant by polymorphism?
  8. Give the syntax of cin and cout statements.
  9. Write a C++ program to find the greatest among 2 integers.
  10. 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)

 

  1. Explain the various input and output functions available in C language.
  2. Write a C program to display all the prime numbers between 1 and 100.
  3. Explain any two types of ‘if’ statements available in C and give an example for each.
  4. Write a C program to accept ‘n’ integers and display them in ascending order.
  5. What is meant by object oriented programming? Explain its advantages.
  6. Write a C++ program that makes use of the concept of friend function.
  7. Write short note on recursive functions and give an example.
  8. Write a C++ program to accept ‘n’ integers and display their mean and variance.

 

SECTION C

      Answer any TWO questions.                                                           (2 x 20 = 40)

 

  1. 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)

  1. 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)

  1. a.) Explain the different access specifiers available in C++ with examples.

b.) Write a C++ program to overload the operator ‘+’.                       (10+10)

  1. a.) Write short notes on structures and arrays.

b.) Write a C++ program that makes use of the concept of simple inheritance.                                                                                                                                 (10+10)

 

Go To Main Page

© Copyright Entrance India - Engineering and Medical Entrance Exams in India | Website Maintained by Firewall Firm - IT Monteur