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
-
1 Introducing the .NET Framework with C# The .NET Framework is such a comprehensive platform that it can be a little difficult to descr...
-
Introduction: In this exercise, you will exercise the concept object creation using new keyword. We will learn how you are going to create ...
-
In previous chapters, you learned to how to connect to SQL Server 2005 using management studio. In this chapter, you will learn how to creat...
-
Adding Controls to the Form There are many controls you can use with your program: Buttons, Text Boxes, Pictures, Scroll Bars and more. You ...
-
Additional Command Button's Properties Add 1 Command Button to your form, and change the following properties to see what they do. Capti...
-
The SQL AVG aggregate function selects the average value for certain table column. Have a look at the SQL AVG syntax: SELECT AVG(Column1) FR...
-
DATATYPES: there are 3 types of datatypes those are: a)primary datatypes b)user-defined datatypes c)derived data types primary datatypes are...
-
In the previous chapter, you learned how to connect to SQL Server Database Server . In this chapter, you can find more about how to use Mana...
-
Learning about Properties Every component (form is component for example) has properties, that determine its look and its functioning. Prope...
-
As you already learned, the core part of SQL Server system is the 'server' which runs as a service. The service is a hidden applicat...
No comments:
Post a Comment