diff tests/code/while_2.d @ 12:6282db07115f

Added some ekstra tests, and allowed bool as a type
author Anders Halager <halager@gmail.com>
date Fri, 18 Apr 2008 13:58:27 +0200
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/code/while_2.d	Fri Apr 18 13:58:27 2008 +0200
@@ -0,0 +1,14 @@
+int main()
+{
+    int x = 10;
+    int res = 0;
+    while (x > 0)
+    {
+        res = res + x;
+        x = x - 1;
+    }
+    if (res == 55)
+        return 0;
+    return 1;
+}
+