10th Class Computer – Chapter 2 (C
Language)
Easy English Notes (FSD Board)
1) Escape Sequence
An escape sequence is a special code used in C language to display special
characters in output. It always starts with a backslash \. It helps in
formatting the output such as moving to a new line, giving space, or showing
special symbols.
2)
\n is an escape sequence used to move the cursor to the next line. It is
mostly used in printf() function to print output on a new line.
3) Two Types of Operators in C
Arithmetic and Relational operators are two important types of operators in C
language. Arithmetic operators are used for calculations, while relational
operators are used for comparing values.
4) Assignment Operator
An assignment operator is used to store a value in a variable. It is
represented by the symbol =. It assigns the value on the right side to the
variable on the left side.
5) Relational Operator
A relational operator is used to compare two values. It checks whether one
value is greater, smaller, or equal to another value. It gives the result in true
or false.
6) Arithmetic Operator
An arithmetic operator is used to perform mathematical operations such as
addition, subtraction, multiplication, and division in a program.
7) Unary and Binary Operator
Unary Operator:
A unary operator works on only one operand. It is mostly used to increase,
decrease, or change the value of a variable.
Binary Operator:
A binary operator works on two operands. It is commonly used in calculations
and comparisons.
8) OR, AND, NOT Operator
OR, AND, and NOT are logical operators used to check two or more
conditions in a program. They are mostly used in decision-making
statements.
9) printf() Function
The printf() function is used to display text, numbers, and results on the
computer screen. It helps the user to see the output of the program.
10) Compound Statement
A compound statement is a group of two or more statements written inside
curly braces { }. All these statements work together as a single block in a
program.
11) Use of Statement Terminator
A statement terminator is used to show the end of a statement in C
language. It tells the compiler that one instruction is complete and the next
instruction will start.
12) Statement Terminator
A statement terminator is a special symbol ; (semicolon) used at the end of
every statement in C program to finish it properly.
13) Purpose of gets()
The gets() function is used to take a string as input from the user. It reads
the full line entered from the keyboard and stores it in a variable.
14) Use of scanf() Function
The scanf() function is used to take input from the user. It reads values like
numbers and characters from the keyboard and stores them in variables.
15) Format Specifier
A format specifier is a special symbol used in printf() and scanf() functions to
tell the computer about the type of data.
Examples: %d, %f, %c
16) Logical Operators
Logical operators are used to combine two or more conditions and check
whether they are true or false.
Examples: &&, ||, !
17) Modulus Operator
The modulus operator % is used to find the remainder after division of two
numbers.
Example: 10 % 3 = 1
18) Use of “=” and “==” Operator
The = and == operators are used for different purposes in C language.
Assignment Operator (=):
The = operator is used to store a value in a variable.
Example: a = 5;
Equal To Operator (==):
The == operator is used to compare two values. It checks whether both
values are equal or not and gives result in true or false.
Example: a == 5;
Prepared for Exam Revision and Printing