Saturday, June 28

What are STATEMENTS mean in C++ and Java


Hello friends , let's move to our topic... What is a Statement ?. In C++ a statement in program carries out some action... Generally there are three types of statements , which are as follows:
(i) Expression statement : Here the expression statement consists of any C++ expression followed by a semicolon. The expression statement is generally used to evaluate group of expressions,
For example,
x=y; ........ Here value of y is copied to x......
sum= x+y; ........ Here value of x is added with the value of y and assign it to variaable sum...

(ii) Compound statement : A group of valid C++ expressions placed within a { } statement is called a compound statement.... Here compound statement is not completed with a semicolon.
For example,
{
a = b+c;
x= x*x;
y= a+x;
}
(iii) Control statement : The control statement is used for the program flow and to check the condition of the given expression or a variable or a constant. The keywords used are normally predefined to the compiler......
For example,
(1)if (a==c)
{
......................
.......................
}
(2) while (x>y)
{
.......................
........................
}
This ends our topic of statements in my next post I will tell you about your first ever simple C++ program........... so don't miss it........

0 comments:

Followers

Archive

 

Money ,Entertainment and Education. Copyright 2008 All Rights Reserved Revolution Two Church theme by Brian Gardner Converted into Blogger Template by Bloganol dot com