Today while doing some programming stuff I found one good thing which I never encountered in the past for programming language loops. I know everyone who has done programming used for and while loop some time or the other.
In this post I am just going to give simple example to convert a for loop into while.
For loop
for(Initialization;Condition;INCREMENT/DECREMENT)
{
statements;
}
While equivalent
Initialization
while(Condition)
{
statements;
INCREMENT/DECREMENT
}
example:
int i =0
for(System.out.println("initialization");i <10;System.out.println("increment/decrement"))
{
System.out.println("Inside loop");
}
equivalent while loop:
int i =0;
System.out.println("initialization");
while(i<10)
{
System.out.println("Inside loop");
System.out.println("increment/decrement"); // this should be the last statement in the loop
}
Hub and Switch and Router
I was doing a udemy course to learn more about the networking concepts and wanted to clarify the confusion between Hub, Switch and Router. ...
-
LDAP directory servers contain information about people: users, employees, customers, partners, and others. Many times, it makes sense to as...
-
I have seen many products synchronizing password/ sending password synch events to IDM products when user changes the password in Active Dir...
-
I was doing a udemy course to learn more about the networking concepts and wanted to clarify the confusion between Hub, Switch and Router. ...
No comments:
Post a Comment