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

cds questions

The document outlines the model examination for the C Programming & Data Structures course at Government Polytechnic College, Gandharvakottai, scheduled for October 2023. It includes details on the exam structure, with Part-A consisting of 10 short answer questions and Part-B comprising 5 long answer questions, covering various topics in C programming and data structures. Additionally, it lists important questions and concepts related to the course, including definitions, syntax, algorithms, and data structures.

Uploaded by

nushrath
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)
5 views

cds questions

The document outlines the model examination for the C Programming & Data Structures course at Government Polytechnic College, Gandharvakottai, scheduled for October 2023. It includes details on the exam structure, with Part-A consisting of 10 short answer questions and Part-B comprising 5 long answer questions, covering various topics in C programming and data structures. Additionally, it lists important questions and concepts related to the course, including definitions, syntax, algorithms, and data structures.

Uploaded by

nushrath
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/ 8

Reg. No.

___________________

137-Government Polytechnic College, Gandharvakottai


Model Examination – October 2023
Department of Computer Engineering

Code : 4052330 Duration : 3hrs


Sub. Name : C Programming & Data Max. Marks: 100
Structures
Year/Sem. : II / III Date : 16-1122

PART-A (10 x 3 = 30 Marks)


Answer all questions
1. Define constants and its types.
2. What are basic data types available in C program?
3. Give the syntax of if…else statement with its flowchart.
4. How do you declare and initialize a 1-D array?
5. Give the syntax of the structure and its variable.
6. Give the syntax for malloc(), calloc(), realloac(), free() functions.
7. Give the coding for push() and pop() functions.
8. Define circular queue and dequeue.
9. What are the types of linked list? Depict with a diagram
10. Give the steps (algorithm) in bubble sort.

PART-B (5 x 14 = 70 Marks)
Answer all questions

11. (a) (i) Decsribe program execution steps in C program. (7)


(ii) Explain the steps in program development cycle. (7)
(or)
(b) (i) Give the C operators with its syntax. (10)
(ii) List the formatted and unformatted I/O statements (4)

12. (a) Explain about the various branching statements with syntax,
flowchart and examples. (14)
(or)
(b) (i) Describe the types of looping statements with syntax,
flowchart and examples. (9)
(ii) Give the program for matrix addition (2D- Array). (5)

13. (a) Explain structure with an example program. (14)


(or)
(b) (i) Describe the pointer and its arithmetic with an example
program. (7)
(ii) Give a simple addition program using command line
arguments. (7)
14. (a) (i) Give the different approaches to design an algorithm. (7)
(ii) Give the algorithm for evaluating postfix expression. (7)
(or)
(b) Give the algorithm for conversion of infix to postfix
expression. (14)

15. (a) Write a C program to perform bubble sort with an example (14)
(or)
(b) Write a C program to perform linear search with an
example. (14)

Question types:
Define / What is?

1. Program 2.Arrays 3. Queue and insert, delete


4. Flowchart 5. String 6. Data structure types
7.Algorithm 8.Function 9.Linked list
10.Programming languages. 11.Recursion 12.Degree of a tree
13.Variables. 14.Structure 15.Height of a tree
16.Data types 17.Pointer 18.Ancestors and descendants of
a tree.
19.Constants 20.Dynamic memory allocation 21. Root, parent, child of a tree
22.Keywords 23.Stack and push, pop 24.Leaf node
25.Identifiers 26.Arrays 27.Circular queue, Dequeue

Types of:

Programming Constants-3 Arrays


Languauges
Numeric- int, real, 1-D, 2-D, 3-D, Multi-D,
High level, low level character, String(character array)
String
Dynamic memory Operations on Stack C operators-8
allocation functions-4
Push() Arithmetic, Relational,
malloc()
Pop() Logical, Assignment,
calloc() Operations on queue Conditional, Bitwise
realloc() Insert(), delete() Special, Increment/Decrement
free()
Formatted I/O Linked List-3 Types of expression notation-3
printf(), scanf() Singly linked list Infix notation
Unformatted I/O Doubly linked list Postfix/ reverse polish
notation
gets(), getch() Circular linked list
Prefix/ polish notation
putchar(), puts()

Types of expression-3 Type conversion-2 Queue


Arithmetic expression Automatic/ implicit Circular queue
Real, integer, mixed External/ explicit Dequeue
Relational expression
Logical expression
Approaches to design an Operations on data-6 Branching/ Control statements
algorithm-2 structure
if,
Top Down Insert, delete, search, if…else,
sort, merge, traverse
Bottom Up if…else if…else
switch
Looping statements-3 String handling Built-in functions
functions
while math.h- pow,sin,cos,sqrt
strlen()
do..while conio.h- getch(),clrscr()
strcpy()
for stdio.h- printf(), scanf()
strcmp() ctype.h-
strrev() islower,isdigit,isalpha,tolower,
isupper, toupper
strcat()
graphics.h- drawLine()
File functions Search -2 Sort
fopen(), fclose() Linear/ sequential internal external
search,
fprintf, fscanf merge sort
binary search
getc,getw, putc, putw quick sort
bubble sort
insertion sort
selection sort
shell sort
radix sort
Binary tree traversal -3 Applications of stack
inorder traversal 1.conversion to infix to
postfix
preorder traversal
2. Evaluation of postfix
postorder traversal
3. reversing a list

Syntax for declaration and initializing:


variable datatype variable_name;
datatype variable_name= value;
ex: int a;
int a=5;

String char string_name[size];


char string_name[size]= value;
ex: char city[15];
char city[15]=”Chennai”
Array datatype array_name[size];
datatype array_name={ values };

ex: int a[10];


int a[5]= {1,3,4,2,7};
Structure struct structure_name
{
ex: struct student datatype member1;
{ datatype member2;
char name[10]; ...};
int roll_no;
int m1,m2,m3; structure structure_varaible;
};
struct student s1;

Pointers datatype *pointer_name;


pointer_name=&variable;

ex: int *p;


p=&a;

Difference between:

1. Structure & union


2. Linked list & sequential list
3. While & do- while

Rules or algorithm

1. Naming identifiers.
2. Control statements
3. Infix to postfix
4. Evaluation of postfix
5. Bubble sort
6. Linear search
7. Binary search
8. Tree traversals

Advantages & Disadvantages:

1. Pointers
2. Dynamic memory allocation
3. Linked list
4. Flowchart
5. Algorithm
6. Functions
7. recursion
137- Government Polytechnic College, Gandharvakkottai.
Department of Computer Engineering
Odd Semester (2023-2024)
4052330- C Programming & Data Structures
Important Questions
3 marks:

Unit –I

2. Give the rules for naming the identifier. 1.18


3. Define tokens. List its types.
4. Differentiate constants and its types. 1.19
5. Define algorithm and list its properties.1.06
6. Define and Draw the flowchart symbols and list its advantages. 1.07
7. Give the structure of C program. 1.11
8. Give the syntax for declaring and initializing variables and strings. 16, 1.31. 1.32
9. Define comment statement and control strings.
10. Define symbolic constants and escape sequences.
11. Define program. What are the steps in program development cycle? 1.01
12. What are the two types of programming languages? 1.04
13. What are the steps in executing a C program? 1.13 Draw the diagram.
14. Define keywords with examples -1.17
15. Define data types and give its types. 1.27, 1.28
16. What is type conversion and give its types? 1.56
17. What are unformatted input output statements? 1.69
18. What are formatted input output statements? 1.60

Unit II

1. Define arrays Give the syntax to declare and initialize arrays.(1D/2D/3D) 2.39
2. What are decision making/conditional/branching/ control statements? (syntax & flowchart)
2.01
3. What are the rules for control statements? 2.07
4. What are unconditional branching statements. (goto break conitnue) 2.15
5. What are looping statements? 2.16 (syntax & flowchart)
6. Defne strings. How to declare and initialize it?
7. List some string handling functions? 2.66
8. List some built in functions. 2.77
9. Define functions and its advantages. 2.87
10. Define return statement 2.89
11. What are formal and actual arguments- 2.92
12. What is call by value and call by reference 2.93
13. Define recursion. 2.107 advantages and disadvantages.

Unit III, IV, V:


1. Define structure with its syntax 3.0
2. How to declare and initialize structure variables - 3.04
3. Diferentiate structure and union. - 3.22
4. Define pointers. How to declare and initialize it? 3.22
5. Define dynamic memory allocation, advantages, disadvantages and list its functions 3.35
6. Define the two types of approaches to design an algorithm.4.08 - 7marks
7. Give the coding for push( ) and pop( ) operations. Notes / 4.13 , 4.14
8. What is a circular queue and dequeue? 4.40, 4.41
9. Give the advantages of pointers.3.23
10. Give the syntax for realloc( ), malloc(), calloc(), free() function. 3.36
11. Define data structure and types -4.01
12. Define stack and its operations. 4.10
13. What are the operations on data structures? 4.07
14. What are the applications of stack? 4.18
15. Define queues and its operations. 4.32
16. Types of notation expression.
17. Define linked list / list 5.01
18. Types of linked list/ list 5.03
19. Difference between linked list and sequential list/array. 5.07
20. Advantages and disadvantages of list 5.07
21. What are tree terminologies? 5.08
22. Three traversals of binary tree- 5.14
23. Define sorting and its types. 5.20
24. Define search. What are the two type of search? 5.30

14 marks and 7 marks:


Unit I
1. Explain about the operators in C. 1.36
2. Write in detail about the program development cycle. 1.01
3. Program execution steps and diagram 1.13
4. What are formatted and unformatted I/O statements. 1.60

Unit II

1. Describe the control statements with flow diagram and syntax.2.01


2. Describe looping statements. 2.16
3. Write the (2D-array) matrix addition program C & DS practical Ex No. 13
4. Explain the string handling functions with the syntax.2.66
5. Explain recursion with example.2.107

Unit III, IV, V

1. Give a program using structures to print the details of students to print their total. Notes/ 3.10 /
Ex. No. 5 in C & DS Lab Manual
2. Explain pointer usage and arithmetic with an example program. Notes / 3.33
3. Describe the command line arguments with a sample program. 3.55
4. Depict the different types of data structures along with the operations performed on it. 4.05, 4.07
5. What are the three types of expressions? Give the algorithm to evaluate a postfix expression
using stack. 4.20, Notes / 4.28
6. Algorithm to convert infix to postfix with example.Notes/ 4.23
7. Give the approaches to design an algorithm.4.08
8. Bubble sort example and algorithm program 5.21
9. Linear search- algorithm example program. 5.31
10. Binary search- algorithm exampe program. 5.33
11. What are the three types of tree traversal? 5.14

You might also like