B.C.A. Examination, 2018
Time: Three Hours Maximum Marks: 75
Note: Attempt any five questions. All question carry equal marks. The answer to short questions should not exceed 200 words and the answer to long answer type questions should not exceed 500 words.
- (A) Design an algorithm to compute the first ten terms of the following series:
0,1,1,2,3,5,8,…………………….
Convert the above algorithm into a well documented C program.
(B) Explain the syntax of the switch statement with an example.
2. Write a recursive program in C language to compute the factorial of input number N where value of N is accepted from the keyboard at rum time.
3. (A) In a C program, print all the prime numbers from 1 to 200.
(B) Write a C program using the switch case facility to incorporate multiway branching for converting an integer number from 1 to 12 to the name of the corresponding month in the following way:
1 January
2 Febuary
3 March ………………….. 12
December
The program should accept an integer input from 1 to 12 and print the name of the corresponding month in words.
4. (A) Write a C program to compute the square and square root of an integer A after reading the value of A from the keyboard.
(B) Write the algorithm and C program for testing whether an integer N is a perfect number.
5. (A) What do you understand by bitwise and logical operators? Discuss with examples.
(B) Why is C known as a functional language? What are the basic structure of programming? Explain reach with a specific example and syntax.
6. Illustrate with example:
(A) Nested loop
(B) Break and continue
(C) Recursion
7. What do you understand by the Binary Search Technique? What are its preconditions? Trace it out on a randomly distributed list of numbers.
8. Write short notes on :
(A) Big-oh Notation
(B) Pseudo code
(C) Header files and their use.
B.C.A. Examination, 2017
Time: Three Hours Maximum Marks: 75
Note: Attempt any five questions. All question carry equal marks. The answer to short questions should not exceed 200 words and the answer to long answer type questions should not exceed 500 words.
- Define the following with example:
(A) Token
(B) Bitwise Operator
(C) Escape Sequencing
(D) Switch Statement
(E) Size of Operator
2. Write a C program to compute up to n terms the sum of the AP consisting of the first N natural numbers. The value of n is to be accepted by the user at runtime.
3. Write a C program for computing the GCD of two integers(m,n) by:
(i) Recursion Technique
(ii) Iteration Technique
4. (A) For each statement below, assume that y=100 before the execution of the statement. In each case, What is the value of x after execution:
(i) x=–y*4
(ii) x=y=y++
(iii) x=y==y++
(B) Create variable capable of storing the following:
(i) 15 (ii) 15.899
(iii) “O” (iv) 1000
(v) Scooter Preice (vi) 22.3497736
(C) What is the difference between floating point numbers and double precision numbers? Explain with examples where each may be used.
5. (A) Define the Scanf() function with example.
(B) What are the different arithmetic, logical and shorthand operator present in C language? Enumerate with examples.
6.(A) Write a C program to print out the sum of the Fibonacci sequence up to N terms.
(B) Write a C program to print out the multiplication table I the following format:
MULTIPLICATION TABLE
2 3 4 5 6 20
4 6 8 10 12 40
6 9 12 15 18 60
8 12 16 20 24 :
: : : : : : :
: : : : : : :
: : : : : : :
20 30 40 50 60 200
7.(A) In a program, store the five vowel ‘a’, ’e’, ‘I’, ‘o’ & ‘u’ in five suitably declared variables. Then print out the content of the variable in a single line, separated by commas.
(B) What do you mean understand by the nested IF Statement? How is it different from switch? Explain with example.
8. (A) What is the output from the following program:
Main()
{
int i,j;
i=7;
j=++I;
printf(“i=%d, j=%d/n”,I,j);
}
(B) Write as C program that repeatedly asks the user to input a negative or positive number and then echoes it, when the value of O is entered the program should terminate.
9.(A) Write a C program to convert a given octal number into hexadecimal.
(B) Describe and explain the different types of errors that are encountered during the compitation and execution of a C program