0% found this document useful (0 votes)
58 views

Explain The Diff. B/W Structure Unions and Arrays?: Unit 1 Important Questions

This document contains important questions from 5 units of a C programming course - PPS-II. Unit 1 focuses on structures, with questions on nested structures, complex numbers, bit fields, and arrays of structures. Unit 2 covers linked lists, their advantages/applications, and different types. Unit 3 is about searching and sorting algorithms like linear, binary, selection, quick, and insertion sort. Unit 4 deals with stacks and queues, including implementation and conversions between infix, postfix and prefix notation. Unit 5 is on file handling in C, covering functions for input/output, positioning, status and error handling on text and binary files.

Uploaded by

bolt spark
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)
58 views

Explain The Diff. B/W Structure Unions and Arrays?: Unit 1 Important Questions

This document contains important questions from 5 units of a C programming course - PPS-II. Unit 1 focuses on structures, with questions on nested structures, complex numbers, bit fields, and arrays of structures. Unit 2 covers linked lists, their advantages/applications, and different types. Unit 3 is about searching and sorting algorithms like linear, binary, selection, quick, and insertion sort. Unit 4 deals with stacks and queues, including implementation and conversions between infix, postfix and prefix notation. Unit 5 is on file handling in C, covering functions for input/output, positioning, status and error handling on text and binary files.

Uploaded by

bolt spark
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
You are on page 1/ 3

PPS-II

UNIT 1 IMPORTANT QUESTIONS

1. Write a C program to implement nested structures.


2. Write a C program to implement addition and multiplication of two complex
numbers.
3. Write a short note on bit fields, enum, typedef, command line arguments
4. Write a C program to implement array of structures.

5. Differentiate between a structure and a union.(definitions of structure and


union, declaration, defining, initialization, accessing, memory allocation, size)

6. Explain the diff. b/w structure unions and arrays?

7. Explain diff. types of structures with ex. (complex, nested, self-referential)?

8. How the structures are implemented with functions, arrays and pointers?

9. Explain difference between arrays and strings?

10. Define string and write a c program to check whether given no. is palindrome
or not?

11. What are the string handling functions in c and explain each with ex.?

12. Write a c program to count no. of words,lines,characters ?

13. Write a c program to print the string in reverse order?


UNIT 2

1. Write a C program to implement singly linked list for the following operations
A) Create b) insert(all operations) c)delete(all operations)
d)search e) display

2. what are the diff. b/w nonlinear and linear data structures?(static and non-
static)

3. What are the advantages , applications of linked list ?(disadvantages)

4. Explain different types of linked lists?

5. Write a c program to reverse the elements in linked list?.


6. Make a comparison between a linked list and a linear array. Which one will you
prefer to use and when?
UNIT 3

1. Write a C program to implement linear search.

2. Which technique of searching an element in an array would you prefer to use and
in which situation? Explain the algorithm of Binary Search to search for an
element 100 by considering the following elements 8, 22, 37, 49, 81, 99, 105,
113

3. Define sorting. Write a C program to sort a given list of elements using

a. Selection sort b. Quick sort c. insertion sort

4. Explain recursive search with example and program?

5. Compare running time complexity of diff. sorting

algorithms?

6. Implement all sorting algorithms with functions?

UNIT 4

1. Write a C program to implement stack using arrays for the following operations
a) Push() b) pop() c)peek() d) display()
2. Write a C program to implement queue using arrays for the following operations
b) enqueue() b)dequeue() c) display()
3. Write a program to convert an infix expression to a post fix expression. Illustrate
the conversion with the following infix expression as input
A+ B/C* D-E / F*G+ H/ I
4. Write an algorithm to evaluate an expression given in postfix notation. Show the
execution of your algorithm for the following expression.
AB^CD-EF/GH+/+*
5. A letter means enqueue and an asterisk means dequeue in the following
sequence. Give the sequence of values returned by the print operation when this
sequence if operations are performed on an initially empty FIFO queue .

DAT*A*STR***UC***TU*R**E

6. Draw the stack structure in each case when the following operations are
performed on an empty stack.

(a) Add A, B, C, D, E, F (b) Delete two letters


(c) Add G (d) Add H
(e) Delete four letters (f) Add I
7. Define data structure and explain linear and nonlinear data structure?
8. Define infix, postfix, prefix with ex. and explain how to convert infix to postfix
expression with example and program?
9. Write down algorithm steps for push and pop operation?
10. State the diff. b/w queues and stacks?
11. list out diff. types of stack and queue applications?
12. Evaluate the following postfix expression
i.) 5+3*2-1

UNIT 5
1. Write a C program to copy one file to another.
2. Write a C program to merge two files using command line arguments.
3. Write a C program to implement the following file input output operations
a. fprintf(), fscanf()
b. fgetc(), fputc()
c. getw(), putw()
d. fread() and fwrite()
4. Explain file status functions with examples.(feof,ferror)
5. Explain file positioning functions illustrate with a C program.(fseek)

6. Write a short note on error handling functions in files with appropriate


example.(errno,perror,strerror)

7. Explain the diff. b/w text file and binary file?

8. Explain the file operations with ex. programs?

9. Explain diff. types of file mode operation?(read,write,append)

10. Explain file handling functions with ex. program?

11. How to read and write binary file and text file?

12. Explain the concept of multi file with ex. program?

You might also like