Expression is such kind of a program that has its own numeric value as like int a or #define PL etc.Expression is evaluated by assignment ( = )
Variable = Expression
There are two types of expression :
Expression
|
1.Simple Expression
2.Complex Expression
Simple Expression :
Simple Expressions are made by a single part like variable,constant etc.
Simple Expression ---- Description
- Name ---- Variable
- 20 ---- Literal Constant
- MINUTE_PER_HOUR ---- Symbolic Constant
When a simple expression contain any operator like +,-,% etc then it called complex expression.
Ex : 2+8, x=y+5, x=y=10 etc
Statement :
We know we can give instruction to do something to computer through program.Statement is that type of part of a program where an instruction is given by us to computer.Statement could be one or multiple lined.After each statement we must put semicolon( ; ) to complete that statement except #include and # define.
Ex: a=5+10;
p=q;
We can use white space,space,tab in statement.Like
a=5+10
We can write it like below:
a =
5
+
10;
Compound Statements :
When more then one statement stay in between two brace " { } " is called compound statement or block.
Ex :
{
printf("COMPOUND");
printf("STATEMENTS");
printf("EXAMPLE");
}
Post a Comment