Programming in C - CS3251 - Important Questions with Answer - Unit 2 - Arrays and Strings (1)
Programming in C - CS3251 - Important Questions with Answer - Unit 2 - Arrays and Strings (1)
CS3251 - PROGRAMMING IN C
I Year/II Semester
Prepared By,
CS3251_PIC
https://play.google.com/store/apps/details?id=info.therithal.brainkart.annauniversitynotes Page 1 of 5
www.BrainKart.com
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=info.therithal.brainkart.annauniversitynotes Page 2 of 5
www.BrainKart.com
4931_Grace College of Engineering, Thoothukudi
13.Define putchar() :
Single character can be displayed using the function putchar(). The function putchar()
stands for “putchar”and uses an argument.
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=info.therithal.brainkart.annauniversitynotes Page 3 of 5
www.BrainKart.com
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=info.therithal.brainkart.annauniversitynotes Page 4 of 5
www.BrainKart.com
4931_Grace College of Engineering, Thoothukudi
PART B
1.Explain Selection Sort in C
CS3251_PIC
https://play.google.com/store/apps/details?id=info.therithal.brainkart.annauniversitynotes Page 5 of 5
All 2nd Semester Subjects
Professional English - II - HS3252 Engineering Graphics - GE3251
Statistics and Numerical Methods - Physics for Electronics Engineering -
MA3251 PH3254
Physics for Electrical Engineering - Physics for Civil Engineering - PH3201
PH3202
Materials Science - PH3251 Basic Electrical and Electronics
Engineering - BE3251
Physics for Information Science - Basic Civil and Mechanical Engineering -
PH3256 BE3255
Basic Electrical and Instrumentation Electric Circuit Analysis (Circuit
Engineering - BE3254 Theory) - EE3251
Programming in C - CS3251 Circuit Analysis - EC3251
Data Structures Design - AD3251