D Programming – While Loop

Hello there, below is a program that show a basic while loop. It is very much like the syntax of C++ and Java. It is really good to remember the parts of a loop like the starting value, end statement and the operation of increment or decrement. Enjoy! 🙂

import std.stdio;

int main(){
	int i = 0;
	
	while(i<11){
		writeln(i);
		i++;
	}
	
	return 0;
}

Here is the output:

d-while

 

Don’t forget to leave a comment below.

Thank you very much.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s