0% found this document useful (0 votes)
18 views9 pages

MKC PPSC 12

First semester

Uploaded by

mmahesh87656
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)
18 views9 pages

MKC PPSC 12

First semester

Uploaded by

mmahesh87656
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/ 9

MUTHAYAMMAL ENGINEERING COLLEGE

(An Autonomous Institution)


(Approved by AICTE, New Delhi, Accredited by NAAC & Affiliated to Anna University)
Rasipuram - 637 408, Namakkal Dist., Tamil Nadu

MUST KNOW CONCEPTS MKC


CSE 2022-23

SUBJECT 21GES01-PROGRAMMING FOR PROBLEM SOLVING USING C

S.N Notation Concept/Definition/Meaning/Units/Equation/Exp Units


TERM
O ( Symbol) ression
UnitI - INTRODUCTION TO C PROGRAMMING
A programmable electronic device designed to
1 Computer accept data, perform prescribed mathematical and
logical operations at high speed
Components of
2 Computer Hardware and Software
System
Electronic device, hence one can touch and see the
3 Hardware
hardware
Computer Input Devices
4 Output Devices
Hardware
Secondary Storage Devices
categories CPU
Software is a set of programs, which is designed to
5 Software
perform a well-defined function
Software Application Software
6
categories System Software
collection of programs designed to operate, control,
7 System and support the operation of computer itself
Software Ex :compiler, assembler, debugger, driver, etc

Application Program that accomplish user task.


8
Software Ex:Word processor, Railways Reservation S/W ,etc
High-Level Easy to understand and human-readable program
9
Language Examples: C++, C, JAVA, FORTRAN, etc
Machine Binary digits 0 and 1, these binary digits are
10
Language understood and read by a computer system
Program Design Tools used to develop a program. Ex: Algorithms,
11
Tools Flowcharts, Pseudo codes
12 Algorithms Sequence of steps to solve a particular problem

13 Flowcharts Diagram that represents a workflow or process

1
14 False code represents the program, It cannot be
Pseudo codes
compiled or run like a regular program
15 main function from where the program execution
main()
begins
16 scanf() Commonly used function to take input from the user
This function is used for displaying the output on the
17 printf()
screen
18 Predefined, reserved words used in programming, It
Keyword
have a special meaning. Ex: int, switch, for ect…
Name given to entities such as variables, functions,
19 Identifier structures Ex: int a, b; / Here, a and b are
identifiers
Fixed values that the program may not alter during
20 Constants
its execution
Name of the memory location, used to store data
21 Variables and its value can be changed, and it can be reused
many times
Operators to perform tasks including arithmetic,
22 Operators in C
conditional and bitwise operations
Type casting is a way to convert a variable from one
23 Typecasting
data type to another data type
Types of if statement
if-Else statement
24 conditional
if-Else if ladder
statements in C
Switch statement
while loop
25 Type of Loops for loop
do..while
UNIT-II FUNCTIONS, ARRAYSAND STRINGS
A function is a self-contained block or a sub-
26 Functions program of one or more statements that performs a
special task when called.
Function declaration is a declaration statement that
27 Function identifies a function with its name, a list of
Declaration arguments that it accepts and the type of data it
returns.
A function with void result type ends either by
28 Void Function reaching the end of the function or by executing
a return statement with no returned value.

29 A function call is a request made by a program that


Function Call
performs a predetermined function
Call By Value Call by value in which values of the variables are
30
passed by the calling function to the called function.
Call By Call by reference in which address of the variables
31 Reference are passed by the calling function to the called
function.

2
An array is a collection of similar data elements.The
elements of the array are stored in consecutive
32 Arrays memory locations and are referenced by an index
(also known as the subscript).
Linear search is also called sequential search. Linear
33 Linear Search search is a method for searching a value within
a array.
Binary search works on sorted arrays. Binary
34 Binary Search search begins by comparing an element in the
middle of the array with the target value.
Two A two dimensional array is specified using two
35 Dimension(2D- subscripts where one subscript denotes row and the
Array) other denotes column.
int main means that our function needs to return
36 int main some integer at the end of the execution and we do
so by returning 0 at the end of the program.
37 Types of Predefined functions
function User defined functions
for (c = 0; c < m; c++)
38 How to read the
for (d = 0 ; d < n; d++)
Matrix
scanf("%d", &second[c][d]);
Formula for sum[c][d] = first[c][d] + second[c][d];
39 Addition of two
matrix
40 New Line
/n

41 scanf( ) scanf( ) allows to read more than just a single


character at a time.
Why header Each header file has ‘h’ extension and include using
42 files are ’# include’ directive at the beginning of a program.
included in ‘C’
programming?
Define
43 delimiters in ; () [] {} # ,
‘C’.
What is meant
44 If a function calls itself again and again, then that
by Recursive
function is called Recursive function.
function?
Is it possible to
place a return
45 statement Yes. The return statement can occur anywhere.
anywhere in ‘C’
program?
1. Syntax errors
types of errors
2. Runtime errors
46 occurred in C
3. Logical errors
program
4. Latent errors
1.One-Dimensional Array
47 What are the
2. Two-Dimensional Array
types of Arrays?
3. Multi-Dimensional Array
48 sequence of characters
String

3
1strcpy(s1,s2);
2strcat(s1, s2);
49 String 3strlen(s1);
Functions in C 4strcmp(s1,s2);
5strchr(s1,ch);
6strstr(s1,s2);
It is used to create a new data using the existing
type.
50 typedef Example:
typedef int hours: hours hrs;/* Now, hours can be
used as new datatype */

UNIT-III STRUCTURESAND UNION

51 Structure Use to combine data of different types together

struct structure_ name


{
structure_element 1;
Declaring
52 structure_element 2;
Structure
structure_element 3;
Variables
};
struct structure_namev1,v2…vn;
v1,v2….vn arestructure variable
Declaring struct student *report, rep;
53 structure using
pointer variable
Accessing report.mark;
structure report.name;
54
members using report.average;
normal variable
Accessing eport -> mark;
structure memb report -> name;
55
ers using report -> average;
pointer variable
Rules for Thetemplateis terminated with a semicolon
declaring a Thetagname such as book _ bank can beused
56
structure todeclarestructurevariables of its type, laterin
theprogram.
After declaring the structure type, variables and
Accessing
members, the member of the structure can be
57 structure
accessed by using the structure variable along with
elements
the dot(.) operator.
Access pointer -> - Structure pointer operator
58 members of a
structure
Likeanyotherdata type,astructurevariablecan
beinitialized at compiletime.
Structure main()
59
Initialization {
struct
{
4
int weight; float height;
}
student ={60, 180.75};

Nested Structure with in another structure is called nested


60
structures structure
Copying and Two variables of the same structure type can be
61 Comparing copied the same way as ordinary variables.
Structure If e1 and e2 belong to the same type, then the
Variable following statement is valid. e1 = e2, and e2 = e1;
Structure Can
62 Be Accessed In Using normal structure variable
two Ways In a Using pointer variable
C Program
Pointers to struct Books *struct_pointer;
63
Structures
A union is a special data type available in C that
64 Union allows to store different data types in the same
memory location.
65 Function to reallocate the allocated memory.
Realloc

66 Function to allocate memory.


Malloc

67 Used to delete the allocated memory.


Free

68 Nested Union Union within another Union.

69 Sizeof Returns the size of the structure.


Selection Higher Precedence Operator Used to access memory
70
Operator location.
union [union name]
{
type member_1;
71 Syntax of Union type member_2;
...
type member_n;
};
72 Advantages of
Union takes less memory space.
Union
73 Disadvantage of
Access only one data member at a time.
Union
74 Advantages of Stores more than one data type of same object
Structure together
Disadvantages Complexity increases hard to manage all data
75
of Structure members.

5
UNIT-IV POINTERS
A pointer is a variable whose value is the address of
76 Pointers
another variable
Declaring a type. Datatype* pointer-name;
77
pointer

Accessing Theindirection operator(*)is used to access thevalue


78 aVariable ofavariable byits ptr
Through its * can berememberedasvalue at address
Pointer
A pointeris said to benull pointer when its right
79 Null pointer value is 0.
A null pointercan neverpoint to valid data.
Pointer to chain of pointers. int **var;
80
pointer
81 Address of var variable
& var

82 Value of *ip variable


*var
Void Pointer
83 Types of
Null Pointer
Pointers
Dangling Pointer
84 If null value is assigned to a pointer.
Null Pointer

85 Pointer declared with void key word.


Void Pointer

86 Wild Pointer It does not associated with any address.

87 Dangling Pointer points to de-allocated memory location


Pointer
Use Cases of Array of Pointers.
88
Pointer Call by Reference.
Call By Memory Location Address is passed to the calling
89
Reference function.
Advantages of Effective way to access array structure elements.
90
Pointers in C Useful in dynamic memory allocation.
Disadvantages Slower than regular variables.
91
of Pointers in C May cause Memory Leakage.
92 Pointer to
Also called as Double Pointer.
Pointer
93 It is a pointer to a another pointer
Double Pointer

94 Complex Pointers with multiple levels of indirection.


Pointer
95 It stores 16 bit address.
Near Pointer

96 Far Pointer It stores 32 bit machine address.


Size of huge 4 bytes
97
Pointer
98 Huge Pointer 32 bit Fixed Pointer.

6
99 If null value is assigned to a pointer.
Null Pointer
32 bit.
100 Size of far
Pointer
UNIT-V FILEPROCESSING

101 FILE File is a collection of bytes that is stored on


secondary storage devices like disk
fopen() – To open a file
102 Opening/Creati FILE *fopen (const char *filename, const char
ng a file
*mode)
103 Closing a file fclose() – To close a file
Declaration int fclose(FILE *fp);
104 Reading a file fgets() – To read a file
char *fgets(char *string, int n, FILE *fp)
Writing in a file fprintf() – To write into a file
105 Declaration: int fprintf(FILE *fp, const char
*format);
A file represents a sequence of bytes, regardless of it
106 File Processing
being a text file or a binary file.
fopen( ) function is used to create a new file or to
107 Opening Files
open an existing file
fseek () function moves file pointer position to given
108 fseek ()
location.
109 SEEK_SET SEEK_SET moves file pointer position to the
beginning of the file
110 SEEK_CUR SEEK_SET moves file pointer position to the
beginning of the file.
111 SEEK_END SEEK_END moves file pointer position to the end
of file.
112 ftell () ftell () function gives current position of file pointer

rewind () function moves file pointer position to the


113 rewind ()
beginning of the file.
114 remove () remove () function deletes a file.

115 fflush () fflush () function flushes a file.


r- Opens an existing text file for reading purpose
116 File mode w- Opens a text file for writing
a- appending mode
r+ / w+ - Opens file for both reading and writing
A sequential access file is such that data are saved in
117 Sequential sequential order: one data is placed into the file after
access file
another
If the amount of data stored in a file is fairly large,
118 Random access the use of random access will allow you to search
file
through it quicker.
Read
119 File Operations Write
Append
120 Read operation Reading a file from the memory

7
121 Write Writing a file to the memory
Operation
122 Append Appending data to the existing file.
Operation
123 Ways to Access Direct Access.
a file Sequential Access.
124 Fgetw() Reads an Integer from a file.

125 Fscanf() Reads data from a file.

GATE/Placement Related Questions


iter()- To create an iterator
iterator protocol next()- To iterate to the next element
126

127 Tuple packing we place value into a new tuple

we extract those values back into variables.


128 Tuple
unpacking
129 frozen set Frozen set is immutable ,we cannot change its
values.
In case the cache expires, what happens when a
130 Dogpile effect client hits a website with multiple requests is what
we call the dogpile effect.
131 JSON JSON stands for JavaScript Object Notation.

form of automatic memory management which


132 Garbage
collection attempts to reclaim no longer use of memory
This looks for all substrings where the regex pattern
133 sub()
matches, and replaces them with a different string
Like sub(), this returns the new string and the
134 subn() number of replacements made

135 map() This function applies a function to


each element in the iterable.
136 filter() This function lets us keep the values that satisfy
some conditional logic.
137 reduce() This function reduces a sequence pair

A lambda function is a small anonymous function.It


138 Lamda() can take any number of arguments, but can only
have one expression.

Is Python call- Python is neither call-by-value, nor call-by-


139 by-value or call- reference. It is call-by-object-reference
by-reference?
140 __init__() __init__() is what we need to initialize a class
when we initiate it.
141 Case sensitive Python is a case-sensitive language. This means,
Variable and variable are not the same
Name famous Cpython & jpython
142 python
interpreter

8
PY is a script file format used by Python
143 Extension of
python file
144 pointer Variable that contains address of
another variable
Structure is another user defineddata type available
145 Structure in C that allows to combine data items of different
kinds.
A union is a special data type available in C that
146 Union allows to store different data types in the same
memory location.
It refers to any declaration within the parentheses
147 Parameter following the function name in a function
definition;
148 argument It refers to any expression within the
parentheses of a function call.
Formal A variable and its type as they appear in the
149
Parameter prototype of the function or method.
The variable corresponding to a formal
Actual
150 parameter that appears in the function or method call
Parameter
in the calling environment.

Faculty Team Signatures


Prepared

HoD

You might also like