Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Problem Solving Using CMarch 2018

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

D52730 (Pages: 3) Name.....

-·--·····--····-·--····
Reg. No.·-··---·----·-··-······-·

FIRST SEMESTER B.Sc. DEGREE EXAMINATION, NOVEMBER 2018


(CUCBCSS-UG)
Core Course (Computer Science)
BCS 1B 01-PROBLEM SOLVING USING C
(2014 Admissions)
Time . : Three Hours Maximum : 80 Marks
Part A
Answer all questions.
Each question carries 1 mark.

1. Which of the following is not a vali d C variable name ?

(a) int number ; (b) float rate;


(c) int variable_count ; (d) int $main ;

2. What is the output of the following C code ?


# include <Stdio.h>
#define a 10

int main()
{

const int a = 5;

}
(a) a= 5. (b ) a= 10.

(c) Compilation error. (d) Runtime error.

3. ---- is the arithmetic operator with lowest precedence.


4. A block of memory can be allocated using the function ----

5. Flowchart is a logic development tool (TRUE/FALSE)

6. Maximum number of argumen� that a function can take is 12 (True/False)

Tuna over
2 D 52730

7. Which type of files can't be opened using fopen()?

(a) .txt. (b) .bin.

(c) .c. (d) None of the mentioned.

8. What is the output of the C code?


# include <stdio.h>

int main()
{

int i=lO;

int *p=&I;

printf("%d\n", *p++);
}.

(a) 10. (b) 11.

(c) Garbage value. (d) Address of i.

9. If there is any error while opening a file, fopen() will return----

(a) Nothing. (b) EOF.


(c) NULL. (d) Depends on compiler.

10. A ---- is a collection of data items under one name in which the items share the same
storage.
(10 X 1 = 10 marks)
PartB

Answer all five questions.


Each question carries 2 marks.

11. What is the basic structure of a C program?

12. What are keywords and identifiers ?

13. Write the general form of conditional operator and explain the evaluation procedure.

14. Explain how one dimensional array is decl&red and initialized?

15. How pointer variables are initialized?


(5 x 2 .: 10 ruarkb)
3 D 52730

PartC

Answer an.y five questions.


Each question carries 4 marks.

16. Write an algorithm and draw a flowchart to find first and second largest of n numbers?

17. Write a program to compute the sum of digits of a given integer number to a single digit ?

18. Explain the concept of call by value and call by reference with suitable examples ?

19. Differentiate between structure and union with suitable examples ?

20. Explain any two string handling functions with example ?

21. Write a program to check whether a number is palindrome or not ?

22. What are pointers ? Explain how to perform arithmetic operations on pointers ?

23. Write a program to display the prime numbers in a list of numbers ?


(5 X 4 = 20 marks)
PartD

Answer any five questions.


Each question carries 8 marks.

24. Explain the different types of data types available in Cwith examples.

25. Explain a) Arrays of structures b) Multidimensional arrays.

26. E.i:plain different looping structures available in Cwith suitable examples.

27. Write a recursive function to generate and print first n Fibonacci numbers.

28. What are pointer expressions ? Write a program using pointers to compute the sum of all elements
stored in an array.

29. Write a program to merge two sorted array in to a single sorted array in ascending order.

30. What are Preprocessor directives in C? Explain various forms of macro substitution.

31. Write a program that appends one file at the end of another file.

(5 x 8 = 40 marks)

You might also like