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...
// Calculate the height of a plane of gradient 1 // in both the x and y directions.
int main(){
  ...
» double x, y, z, distance; » x=2.1; » y=1.3; » z=x+y; » distance=sqrt(x*x+y*y+z*z); » printf("Distance; %g\n", distance); // See what happens now » x=10.0; » y=y+x; » printf("Distance; %g\n", distance); // More code here... » return 0;
}

Data

x (double)   y (double)
128   136
4.24399158e-312
  
-2.45864802e+267
z (double)   distance (double)
144   152
-9.61808908e+266
  
4.94182803e-270

Memory

main()

128
129
130
131
132
133
134
135
x = 4.24399158e-312
136
137
138
139
140
141
142
143
y = -2.45864802e+267
144
145
146
147
148
149
150
151
z = -9.61808908e+266
152
153
154
155
156
157
158
159
distance = 4.94182803e-270

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

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

Distance; 4.20238
Distance; 4.20238
                                                                                                                                                                                                                                                                       

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