unit 2 qb
unit 2 qb
in
4931_Grace College of Engineering, Thoothukudi
TWO MARKS
1.Define scanf() function:
Scan f () function is used to read the value from the input device.
12.what is getchar() :
Getchar () function is used to read one character at a time from the standard input
device.
CS3251_PIC
https://play.google.com/store/apps/details?id=com.poriyaan.poriyaan 2
www.Poriyaan.in
4931_Grace College of Engineering, Thoothukudi
13.Define putchar() :
Single character can be displayed using the function putchar(). The function putchar()
Two dimensional array is an array with two subscript values. First subscript specifies the
row & second subscript specifies the column. Used to process matrix operations.
Declaration : datatype array_name [r][c];
CS3251_PIC
https://play.google.com/store/apps/details?id=com.poriyaan.poriyaan 3
www.Poriyaan.in
4931_Grace College of Engineering, Thoothukudi
int matrixA[10][10];
This matrixA can store 100 elements in a row major order.
8. Define Searching
Searching is a process of finding the position of a given element in a list. The searching
is successful if the element is found. There are two types of searching.
Linear Search
Binary Search
9. Define Sorting
10. Sort the following elements using selection sort method. 23,55,16,78,2
Step1:Find smallest element in the list & exchange the element with first element of the
list
2,55,16,78,23
Step2: Find second smallest value & exchange it with the second element of the list
2,16,55,78,23
Step 3: Continue the process until all the elements are arranged in the order
2,16,23,78,55
Step 4: 2,16,23,55,78
CS3251_PIC
https://play.google.com/store/apps/details?id=com.poriyaan.poriyaan 4
www.Poriyaan.in
4931_Grace College of Engineering, Thoothukudi
PART B
1.Explain Selection Sort in C
CS3251_PIC
https://play.google.com/store/apps/details?id=com.poriyaan.poriyaan 5
Programming in C
EEE
ECE
Elective-Management
Professional Elective II
Professional Elective IV