annotate tests/code/while_2.d @ 206:d3c148ca429b

Major moving of files. all src now goes into src, all docs in docs.
author Anders Johnsen <skabet@gmail.com>
date Tue, 12 Aug 2008 18:14:56 +0200
parents 6282db07115f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12
6282db07115f Added some ekstra tests, and allowed bool as a type
Anders Halager <halager@gmail.com>
parents:
diff changeset
1 int main()
6282db07115f Added some ekstra tests, and allowed bool as a type
Anders Halager <halager@gmail.com>
parents:
diff changeset
2 {
6282db07115f Added some ekstra tests, and allowed bool as a type
Anders Halager <halager@gmail.com>
parents:
diff changeset
3 int x = 10;
6282db07115f Added some ekstra tests, and allowed bool as a type
Anders Halager <halager@gmail.com>
parents:
diff changeset
4 int res = 0;
6282db07115f Added some ekstra tests, and allowed bool as a type
Anders Halager <halager@gmail.com>
parents:
diff changeset
5 while (x > 0)
6282db07115f Added some ekstra tests, and allowed bool as a type
Anders Halager <halager@gmail.com>
parents:
diff changeset
6 {
6282db07115f Added some ekstra tests, and allowed bool as a type
Anders Halager <halager@gmail.com>
parents:
diff changeset
7 res = res + x;
6282db07115f Added some ekstra tests, and allowed bool as a type
Anders Halager <halager@gmail.com>
parents:
diff changeset
8 x = x - 1;
6282db07115f Added some ekstra tests, and allowed bool as a type
Anders Halager <halager@gmail.com>
parents:
diff changeset
9 }
6282db07115f Added some ekstra tests, and allowed bool as a type
Anders Halager <halager@gmail.com>
parents:
diff changeset
10 if (res == 55)
6282db07115f Added some ekstra tests, and allowed bool as a type
Anders Halager <halager@gmail.com>
parents:
diff changeset
11 return 0;
6282db07115f Added some ekstra tests, and allowed bool as a type
Anders Halager <halager@gmail.com>
parents:
diff changeset
12 return 1;
6282db07115f Added some ekstra tests, and allowed bool as a type
Anders Halager <halager@gmail.com>
parents:
diff changeset
13 }
6282db07115f Added some ekstra tests, and allowed bool as a type
Anders Halager <halager@gmail.com>
parents:
diff changeset
14