0% found this document useful (0 votes)
177 views3 pages

BCA 1st Sem Problem Solving in C

Uploaded by

rigzen namgail
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
177 views3 pages

BCA 1st Sem Problem Solving in C

Uploaded by

rigzen namgail
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

----·-., .

Q.P. Code : 15121

First Semester B.C.A. Degree Examination,


November/December 2019
(CBCS Scheme - Freshers & Repeaters)

Computer Science

Paper BCA 103 T - PROBLEM SOLVING TECHNIQUES USING C


Time : 3 Hours]
[Max. Marks : 70

Instructions to Candidates: Answer all Parts.

PART-A

I. Answer any TEN questions. Each question carries 2 marks : (10 X 2 = 20)
1. Define algorithm.
,..
' 2. What is structured programming?

3. Explain ternary operator.

4. Define the different types of type conversion with example.

5. Explain break and continue.

6. What is function prototype?

7. Define array. How can an array be initialized?

8. Write any four mathematical functions available in 'C'.

9. Define pointer with example.

10. What is enumerated data type?

11. Write any four file functions.

12. How does structure differ from Union?

PART-B

II. Answer any FIVE questions. Each question carries 10 marks : (5 X 10 = 50)

13. (a) Explain the structures of 'C' program with an example. (5)

(b) What is software? Mention the classification of software. (5)

1/2
Q.P. Code : 15121

14. (a) Explain the different data types supported by 'C'. (5)

(b) Explain arithmetic operators with an example. (5)

15. (a) Explain the different looping statements with an example. (7)

(b) What are formatted I/O functions in 'C'? (3)

16. (a) Write a C Program to display fibonacci s_e ries using recursive function (5)

(b) What is a function? Explain with an example passing of arguments to


functions. (5)

17. (a) Write a C program to find the product of two matrices. (5)

(b) Explain different storage classes in 'C' language. (5)

18. (a) Explain string operations with an example. (5)

(b) Explain switch statement in 'C' with an example. (5)

19. (a) Write a note on call by value and call by reference with an example. (5)

(b) Explain command line argument. (5)

20. (a) What are preprocessor directives? (5)

(b) Explain static and dynamic memory allocation. (5)

2/2
t

Common questions

Powered by AI

Function pointers in C store addresses of functions, allowing dynamic invocation of functions. They facilitate callbacks, implementing function tables, and event-driven programming, offering high versatility. This abstraction supports complex scenarios like designing flexible APIs and achieving runtime polymorphism .

The 'break' statement immediately terminates a loop's execution and transfers control to the statement following the loop. Conversely, the 'continue' statement skips the current iteration and jumps directly to the condition evaluation for the next loop iteration. Both modify normal loop execution, allowing for more dynamic control within loops .

A function prototype in C declares a function's signature, including its return type, name, and parameters, without providing the function body. It enables the compiler to ensure correct function calling, providing type-checking and helping prevent errors. It establishes an interface for the function, facilitating modular programming and code reusability .

Preprocessor directives in C are instructions processed by the preprocessor before actual compilation starts. They perform tasks like macro substitution, file inclusion, and conditional compilation, enhancing code modularity, portability, and efficiency .

Dynamic memory allocation is preferred when memory needs can vary or are unknown at compile time, allowing runtime memory management. This is crucial for applications with dynamic data structures like linked lists or when implementing complex data models, offering flexibility and optimizing memory use, unlike static allocation which allocates fixed memory at compile time .

Understanding storage classes (auto, register, static, extern) is crucial for choosing the right variable scope, lifetime, and storage duration, impacting performance and memory usage. Proper usage enhances code efficiency, execution speed, and memory management, crucial for resource-constrained environments or high-performance applications .

The 'switch' statement simplifies decision-making by allowing a variable to be tested against a list of values, each associated with a block of code. It offers a clear and organized way to handle multiple conditions, making the code more readable and easier to maintain compared to using multiple 'if-else' statements .

Structures allocate separate memory for each member, allowing simultaneous access, whereas unions share the same memory location for all members, limiting access to a single member at one time. Structures are used when multiple pieces of data need to be stored and accessed simultaneously, while unions are efficient for saving memory when only one value needs to be stored at a time .

Structured programming offers better readability, easier maintenance, and debugging compared to non-structured programming. It enables clear program flow with the use of sequences, selections, and loops, helping reduce program complexity. This leads to more efficient code management and error detection, making it suitable for large applications .

Recursion provides a natural and intuitive way to represent the mathematical definition of the Fibonacci series, leading to simpler and clearer code compared to iterative methods. However, it can be less efficient due to overhead and redundant calculations unless optimized with techniques like memoization .

You might also like