Home » , , » Expression,Statement and Compound Statement

Expression,Statement and Compound Statement

Written By Unknown on Monday, October 7, 2013 | 2:34 PM

Expression :
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


  1.                 Name                                    ----           Variable
  2.                 20                                         ----            Literal Constant
  3.                 MINUTE_PER_HOUR        ----           Symbolic Constant   
Complex Expression :
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");
}

Share this article :

Post a Comment

 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Learn Programming - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger| Distributed by Rocking Templates