import std.stdio; int main () { /* local variable definition */ int a = 100; /* check the boolean condition */
import std.stdio; int main () { /* local variable definition */ int a = 10; /* check the boolean condition using if statement */
import std.stdio; int main () { /* local variable definition */ int a = 10; /* do loop execution */ do { if( a == 15) {
import std.stdio; int main () { /* local variable definition */ int a = 10; /* while loop execution */ while( a < 20 ) {
import std.stdio; int main () { /* local variable definition */ int i, j; for(i = 2; i<100; i++) { for(j = 2; j <= (i/j); j++)
import std.stdio; int main () { /* local variable definition */ int a = 10; /* do loop execution */ do{ writefln("value of a: %d", a);
import std.stdio; int main () { /* for loop execution */ for( int a = 10; a < 20; a = a + 1 ) { writefln("value of a: %d", a);
import std.stdio; void main () { int[string] array1; array1["test"] = 3; array1["test2"] = 20;
import std.stdio; void main () { int[string] days = [ "Monday" : 0, "Tuesday" : 1,
import std.stdio; void main () { int[string] e;// associative array b of ints that are e["test"] = 3;
import std.stdio; void main () { // an array with 5 elements. double a[5] = 5; double b[5] = 10; double [] c;
import std.stdio; void main () { // an array with 5 elements. double a[5]; a[] = 5; writeln("Array a:",a);
import std.stdio; void main () { // an array with 5 elements. double a[5] = [1000.0, 2.0, 3.4, 17.0, 50.0];
import std.stdio; void main () { // an array with 5 elements. double a[5] = [1000.0, 2.0, 3.4, 17.0, 50.0];
import std.stdio; void main () { // an array with 5 rows and 2 columns. int a[5][2] = [ [0,0], [1,2], [2,4], [3,6],[4,8]];
import std.stdio; void main() { int n[ 5 ]; // n is an array of 5 integers // initialize elements of array n to 0
import std.stdio; void main() { int n[ 10 ]; // n is an array of 10 integers // initialize elements of array n to 0
import std.stdio; import std.string; void main() { string s = "H123Hello1"; string result = munch(s, "0123456789H");
import std.stdio; import std.string; void main() { char[] s1 = "hello World ".dup; writeln("Capitalized string of s1 is ",capitalize(s1));
import std.stdio; import std.string; void main() { char[] s1 = "hello World ".dup; writeln("indexOf of llo in hello is ",std.string.indexOf(s1,"llo"));
import std.stdio; import std.string; void main() { char[] s1 = "hello world ".dup; char[] s2 = "sample".dup;
import std.stdio; void main() { string s1 = "Hello"; string s2 = "World"; string s3 = "World";
import std.stdio; void main(string[] args) { string greeting1 = "Good"; writefln("Length of string greeting1 is %d",greeting1.length);
import std.stdio; void main(string[] args) { string greeting1 = "Good"; char[] greeting2 = "morning".dup;
import std.stdio; void main(string[] args) { string greeting1 = "Hello all"; writefln("%s",greeting1);
import std.stdio; union Data { int i; float f; char str[13]; }; void main( ) { Data data; data.i = 10;
import std.stdio; union Data { int i; float f; char str[20]; }; int main( ) { Data data; writeln( "Memory size occupied by data : ", data.sizeof);
import std.stdio; struct Books { char [] title; char [] subject = "Empty".dup; intbook_id; char [] author = "Raj".dup;
import std.stdio; struct Books { char [] title; char [] subject = "Empty".dup; intbook_id = -1;
import std.stdio; struct Books { char [] title; char [] author; char [] subject; intbook_id; }; void main( ) {