What is a program statement?
A program statement is a line that ends with some termination point and instructs the processor to do something.
How many types of program statements?
- Declaration statements
- Definitions or blocks or compound statements
- Assignment statements
- Expressions and conditions
What is an expression?
An expression is a line that consists of arithmetic operators and operands and usually returns a value got as a result from the evaluation of expression.
Eg: 2+3, (a-b)*2
What are Operators and Operands?
Operator is basically a symbol indicating an operation. Each operator specifying an operation to be done on some number of operands. Operands are the values on which the operation has to be performed.
For example in the arithmetic expression a+b
The + symbol is known as operator
And a,b are known as operands.
How many types of operators?
Based on the number of operands, operators in C language are categorized as:
- unary operators: works with single operand Eg: a++
- Binary operators: works with two operands Eg: a+b
- Ternary operators: works with three operands. There is only one ternary operator that is ?: which is also known as shorthand notation for if…else statement. So, we will discuss about this operator in selection statements chapter.
Based on the type of operation they perform operators are divided into:
- arithmetic operators
- assignment operators
- relational operators
- increment & decrement operators
- bit wise operators
- logical operators