Skip to content
EMPS intranet

Back to top
Hi!   Hi!           Start main()

Try stepping through the code


  Value and type of last evaluated expression: Address of array element: Address of array elementx:  (none)

Your browser does not support the canvas element which will make some the features unavailable.

If you are using Internet Explorer within the University of Exeter try going to the Settings menu (probably the gear shape at the top right of this page), selecting "Compatibility View settings", unchecking "Display intranet sites in Compatibility View" and reloading this page.

Code

 Header...
// Exercise: print even numbers
int main(){
  ...
» for ( int maxval=50;maxval<=950; maxval+=50) { » int limit=sqrt(maxval); » if (limit>20) limit=20; » for ( int i=0;i<=limit; i+=2) printf("%d ", i); » printf("\n"); } » return 0;
}

Data

maxval (int)
128
50
limit (int)
132
30
limit (int)
132
25
limit (int)
132
22
limit (int)
132
18
limit (int)
132
20
limit (int)
132
21
limit (int)
132
15
limit (int)
132
28
limit (int)
132
17
limit (int)
132
27
limit (int)
132
7
limit (int)
132
12
limit (int)
132
23
limit (int)
132
30
limit (int)
132
10
limit (int)
132
29
limit (int)
132
14
limit (int)
132
24
limit (int)
132
26
i (int)
136
0
i (int)
136
0
i (int)
136
0
i (int)
136
0
i (int)
136
0
i (int)
136
0
i (int)
136
0
i (int)
136
0
i (int)
136
0
i (int)
136
0
i (int)
136
0
i (int)
136
0
i (int)
136
0
i (int)
136
0
i (int)
136
0
i (int)
136
0
i (int)
136
0
i (int)
136
0
i (int)
136
0

Memory

main(): for()

128
129
130
131
maxval = 50

: for() {...}

132
133
134
135
limit = 30

: for() {...}

132
133
134
135
limit = 25

: for() {...}

132
133
134
135
limit = 22

: for() {...}

132
133
134
135
limit = 18

: for() {...}

132
133
134
135
limit = 20

: for() {...}

132
133
134
135
limit = 21

: for() {...}

132
133
134
135
limit = 15

: for() {...}

132
133
134
135
limit = 28

: for() {...}

132
133
134
135
limit = 17

: for() {...}

132
133
134
135
limit = 27

main(): for() {...}

132
133
134
135
limit = 7

: for() {...}

132
133
134
135
limit = 12

: for() {...}

132
133
134
135
limit = 23

: for() {...}

132
133
134
135
limit = 30

: for() {...}

132
133
134
135
limit = 10

: for() {...}

132
133
134
135
limit = 29

: for() {...}

132
133
134
135
limit = 14

: for() {...}

132
133
134
135
limit = 24

: for() {...}

132
133
134
135
limit = 26

: for()-2

136
137
138
139
i = 0

: for()-2

136
137
138
139
i = 0

: for()-2

136
137
138
139
i = 0

: for()-2

136
137
138
139
i = 0

: for()-2

136
137
138
139
i = 0

: for()-2

136
137
138
139
i = 0

: for()-2

136
137
138
139
i = 0

main(): for()-2

136
137
138
139
i = 0

: for()-2

136
137
138
139
i = 0

: for()-2

136
137
138
139
i = 0

: for()-2

136
137
138
139
i = 0

: for()-2

136
137
138
139
i = 0

: for()-2

136
137
138
139
i = 0

: for()-2

136
137
138
139
i = 0

: for()-2

136
137
138
139
i = 0

: for()-2

136
137
138
139
i = 0

: for()-2

136
137
138
139
i = 0

: for()-2

136
137
138
139
i = 0

: for()-2

136
137
138
139
i = 0

NB: the actual memory address of each variable is the
address shown plus 4292160368 (0xFFD52B70).

Show Advanced options

.
Show output (Before looking at the output, work out what you think it put should be and see if you are right.)

Output

0 2 4 6 
0 2 4 6 8 10 
0 2 4 6 8 10 12 
0 2 4 6 8 10 12 14 
0 2 4 6 8 10 12 14 
0 2 4 6 8 10 12 14 16 
0 2 4 6 8 10 12 14 16 18 
0 2 4 6 8 10 12 14 16 18 20 
0 2 4 6 8 10 12 14 16 18 20 
0 2 4 6 8 10 12 14 16 18 20 
0 2 4 6 8 10 12 14 16 18 20 
0 2 4 6 8 10 12 14 16 18 20 
0 2 4 6 8 10 12 14 16 18 20 
0 2 4 6 8 10 12 14 16 18 20 
0 2 4 6 8 10 12 14 16 18 20 
0 2 4 6 8 10 12 14 16 18 20 
0 2 4 6 8 10 12 14 16 18 20 
0 2 4 6 8 10 12 14 16 18 20 
0 2 4 6 8 10 12 14 16 18 20 
                                                                                                                                                                                                                                                                       

Validate   Link-check © Copyright & disclaimer Share
Back to top