0% found this document useful (0 votes)
8 views5 pages

C Programming Concepts and Exercises

The document contains a series of questions and programming tasks related to the C programming language, covering topics such as input/output functions, operator precedence, modular programming, stack operations, sorting techniques, and linked lists. It includes multiple sets of questions that require explanations, code implementations, and comparisons of different programming concepts. Each question is designed to assess understanding and application of fundamental programming principles in C.

Uploaded by

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

C Programming Concepts and Exercises

The document contains a series of questions and programming tasks related to the C programming language, covering topics such as input/output functions, operator precedence, modular programming, stack operations, sorting techniques, and linked lists. It includes multiple sets of questions that require explanations, code implementations, and comparisons of different programming concepts. Each question is designed to assess understanding and application of fundamental programming principles in C.

Uploaded by

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

SET 1

Q1)
a) Explain the purpose of scanf() & printf()
b) Explain operator precedence and associativity
OR

Q2)
a) Differentiate between variables and constant
b) Write a C program to read two integers and display their sum and difference

Q3)
a) Analyze the advantage of modular programming using function.
b) Explain the use of break and continue statement
OR

Q4)
a) Write a program using switch to perform basic arithmetic operation
b) List and explain different decision making statement in C
(if, if-else, nested if and switch). Provide syntax & small examples for each.

Q5)
a) Analyze the time complexity of stack operation
b) Evaluate recursion as an application of stack. Explain how function calls are stored in the stack during
recursive execution with a suitable example (eg. factorial)

OR

Q6)
a) Explain applications of stack and queue
b) Explain infix, postfix expressions with example

Q7)
a) Explain any two sorting technique
b) List different tree traversal technique

OR

Q8)
a) Design and implement a C program to create a binary tree and perform inorder, preorder and post order
traversal.
b) Compare quick sort and merge sort with respect to time complexity.
SET 2
Ques 1)
a) List and explain different data type and constant available in C with suitable example
b) Differentiate betn variable, identifiers and keyword in C. Provide example and explain the rules that governs
each.

OR

Ques 2)
a) Develop a C program that accepts student marks in five subjects, calculate the total and percentage, display
them with appropriate formatting. Also explain the structure of C program and the purpose of each section
(header file, main function, declaration statement, return statement).
b) Explain various arithmetic, relational, logical and bitwise operator in C. Compare their precedence and
associativity and illustrate your explanation with sample expression and result.

Q3)
a) Compare and contrast the three looping construct in C: for, while, and do-while. Explain how the choice of
loop affects program logic and execution flow with example.
b) Analyze the purpose and behavior of the control statement break, continue and goto. Demonstrate their effect
on program execution by writing short C code example & explaining the flow in each.

OR

Q4)
a) Design and implement a C program that uses function to compute the factorial of a number using both:

1. Call by value
2. Call by reference
Explain function declaration, definition and calling process in detail to compare the memory behaviour
in both approaches.
b) List and explain different decision making statement in C (if, if-else, nested if and switch). Provide
syntax and small example for each.

Q5)
a) Analyze stack implementation using
a) Array
b) Linked list
Compare their advantages, disadvantages & memory behaviour with suitable example.
b) Evaluate recursion as an application of stack. Explain how function calls are stored in the stack during
recursion execution with a suitable example (eg. factorial or Fibonacci) .

OR
Q6)
a) Write algorithm and C code to implement a Deque (Double Ended Queue) using linked list. Demonstrate the
insertion and deletion operation at both end with diagram and example execution.
b) Explain singly linked list and doubly list. Compare them based on structure, memory usage, traversal,
insertion and deletion.

Q7)
a) Describe selection sort, bubble sort and insertion sort. Compare these sorting method in terms of:
a) Number of comparison
b) Number of swaps
c) Time complexity
d) Best and worst-case performance
b) Analyze the working principle of merge sort and quick sort. Explain their divide and conquer approach with
diagram or recursive process flow.

OR

Q8)
a) Write algorithm and C code to implement a binary tree with insertion & traversal operation. Explain how
nodes are stored in memory & discuss how pointers are used to link nodes.
b) Evaluate & compare different searching & sorting technique based on:
a) Time & space complexity
b) Stability
c) Suitable for small vs. large data set
d) Real-life application
SET 3
Ques 1)
a) List and explain different data type & constant available in C with suitable example.
b) Differentiate betn variables, identifiers and keyword in C. Provide example and explain the rules & governs
each.

OR

Ques 2)
a) Develop a complete C program that accepts students marks in five subjects, calculates the total and
percentage and displays them with appropriate formatting. Also explain the structure of the C program and the
purpose of each section (header files, main function, declaration statement).
b) Explain various arithmetic, relational, logical and bitwise operators in C. Compare their precedence and
associativity and illustrate your explanation with sample expression and results.

Ques 3)
a) Compare and contrast the three looping constructs in C: for, while and do-while. Explain how the choice of
loop affects program logic and execution flow with examples.
b) Analyze the purpose and behaviour of the control statement break, continue and goto. Demonstrate their
effect on program execution by writing short C code examples and explaining the flowchart in each case.

OR

Ques 4)
a) Design and implement a C program that uses functions to compute the factorial of a number using both:
a) Call by value
b) Call by reference
Explain the function declaration, definition and calling process in detail and compare the memory behaviour in
both approaches.
b) List and explain different decision-making statement in C (if, if-else, nested if and switch). Provide syntax
and small example for each.

Ques 5)
a) Write the C program to implement insertion and deletion at the beginning and end of a singly linked list.
Show the effect of each operation using a diagram for nodes before and after the operation.
b) Evaluate recursion as an application of stack. Explain how function calls are stored in the stack during
recursive execution with a suitable example (eg. factorial or fibonacci).

OR

Ques 6)
a) Write algorithms and C code to implement a Deque (Double Ended Queue) using linked lists. Demonstrate
the insertion and deletion operation at both ends with diagrams and example execution.
b) Explain singly linked list and doubly linked list. Compare them based on structure, memory usage, traversal,
insertion and deletion.

You might also like