CONTROL STRUCTURES:
Three types of control structures:
1.Decision control structure : if,if else,nested if etc
2.Loop control structure : while loop,do..while loop, for loop,break statement,continue statement.
3.case control structure : switch,goto
1.Decision control structure:
ex: if(condition)
{
block of statements;
}
ex: if(condition)
{
block of statements;
}
else{ block of statements;}
ex: if(condition)//NESTED IF
{
if(condition1)
block of statements;
else
block statements;
}
2.Loop control structure:
ex: while(condition)
{
block statements;
}
ex: do
{
block statements;
}while(condition);
ex: for(initalization;condition;increment/decrement)//ex: for(i=0;i<=10;i++/i--)
{
block statements;
}
3.Case control structure:
ex: switch(condition)
{
case 1: statements;break;
case 2:statements;break;
default:statements;break;
}
Popular Posts
-
What Is Visual Basic and Why do I need it? Visual Basic is Easy to learn Programming language. With Visual Basic you can develop Windows bas...
-
Arguments passed by value and by reference. Until now, in all the functions we have seen, the arguments passed to the functions have been pa...
-
A program is usually not limited to a linear sequence of instructions. During its process it may bifurcate, repeat code or take decisions. F...
-
Polymorphism Polymorphism is one of the crucial features of OOP. It means "one name, multiple forms". It is also called as Overlo...
-
A "service" is an application that can start automatically when the computer starts. There are two start up modes: 1. Automatic - ...
-
STRINGS: The way a group of integers can be stored in an integer array, similarly a group of characters can be stored in a character array. ...
-
4.5 Using FCL Documentation for Types Using the SDK documentation for a given type will likely be a daily or even hourly event when ...
-
<%@page contentType="text/html" import="java.util.*" %> <!-- http://www.roseindia.net/jsp --> ...
-
Simple Binding Data Binding Data Binding is binding controls to data from the database. With data binding we can bind a control to a partic...
-
A JSP expression is used to insert Java values directly into the output. It has the following form: The Java expression is evaluated, conver...
No comments:
Post a Comment