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) { » for ( int i=0;i<=20&&i<sqrt(maxval); i+=2) printf("%d ", i); » printf("\n"); } » return 0;
}

Data

maxval (int)
132
50
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()

132
133
134
135
maxval = 50

: 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

: 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

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

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 
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 
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